From cc484ab97427620a85248931050ca123219a16da Mon Sep 17 00:00:00 2001 From: Carl Montanari Date: Fri, 9 Aug 2024 15:31:49 -0700 Subject: [PATCH] chore: remove pylama/pydocstyle, just use pylint --- .pylintrc | 6 ++++-- Makefile | 2 +- noxfile.py | 7 +++---- pyproject.toml | 10 ---------- requirements-dev.txt | 5 +---- scrapli/channel/base_channel.py | 2 +- scrapli/driver/base/base_driver.py | 2 +- 7 files changed, 11 insertions(+), 23 deletions(-) diff --git a/.pylintrc b/.pylintrc index b9c5caf9..b085f804 100644 --- a/.pylintrc +++ b/.pylintrc @@ -46,7 +46,7 @@ ignore=CVS # Add files or directories matching the regex patterns to the ignore-list. The # regex matches against paths and can be in Posix or Windows format. -ignore-paths= +ignore-paths = ".nox/*,.private/*,build/*,docs/*,private/*,scrapli/transport/plugins/system/ptyprocess.py,site/*,tests/*,venv/*" # Files or directories matching the regex patterns are skipped. The regex # matches against base names, not paths. The default value ignores Emacs file @@ -143,7 +143,7 @@ confidence=HIGH, # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use "--disable=all --enable=classes # --disable=W". -disable=C0103,C0115,R0901,R0902,R0903,R0913,R0914,W1202,W1203 +disable=C0103,C0115,R0401,R0801,R0901,R0902,R0903,R0913,R0914,W1202,W1203 # C0103 = constant-name (a little too aggressive for some things that aren't "really" constants") # C0115 = class docstrings (init doc strings cover this already) # W1202 = use % formatting for logging (ignore, using f-strings) @@ -153,6 +153,8 @@ disable=C0103,C0115,R0901,R0902,R0903,R0913,R0914,W1202,W1203 # R0903 = too-few-public methods # R0913 = too-many-arguments # R0914 = too-many-local-variables +# R0801 = similar-lines +# R0401 = cyclic-import (too many false positives, seems like this is a common complaint :p) # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option diff --git a/Makefile b/Makefile index b11b6d63..d1d4bd87 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ help: lint: ## Run linters python -m isort . python -m black . - python -m pylama . + python -m pylint scrapli/ python -m pydocstyle . python -m mypy --strict scrapli/ diff --git a/noxfile.py b/noxfile.py index 676f2e08..0e20d1fd 100644 --- a/noxfile.py +++ b/noxfile.py @@ -193,9 +193,9 @@ def black(session): @nox.session(python=["3.11"]) -def pylama(session): +def pylint(session): """ - Nox run pylama + Nox run pylint Args: session: nox session @@ -208,7 +208,7 @@ def pylama(session): """ session.install(*_get_install_test_args()) - session.run("python", "-m", "pylama", ".") + session.run("python", "-m", "pylint", "scrapli/") @nox.session(python=["3.11"]) @@ -249,7 +249,6 @@ def mypy(session): session.install(".") session.install(f"mypy{DEV_REQUIREMENTS['mypy']}") session.install(f"types-paramiko{DEV_REQUIREMENTS['types-paramiko']}") - session.install(f"types-pkg-resources{DEV_REQUIREMENTS['types-pkg-resources']}") session.run("python", "-m", "mypy", "--strict", "scrapli/") diff --git a/pyproject.toml b/pyproject.toml index 88c9070a..eb9ac62f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -129,16 +129,6 @@ strict_optional = true module = "scrapli.transport.plugins.system.ptyprocess" ignore_errors = true -[tool.pylama] -linters = "mccabe,pycodestyle,pylint" -skip = ".nox/*,.private/*,build/*,docs/*,private/*,scrapli/transport/plugins/system/ptyprocess.py,site/*,tests/*,venv/*" - -[tool.pylama.pycodestyle] -max_line_length = 100 - -[tool.pylama.pylint] -rcfile = ".pylintrc" - [tool.pydocstyle] match-dir = "^scrapli/*" ignore = "D101,D202,D203,D212,D400,D406,D407,D408,D409,D415" diff --git a/requirements-dev.txt b/requirements-dev.txt index 62779357..b6f35df6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -3,10 +3,8 @@ darglint>=1.8.1,<2.0.0 isort>=5.10.1,<6.0.0 mypy>=1.4.1,<2.0.0 nox==2024.4.15 -pycodestyle>=2.8.0,<3.0.0 pydocstyle>=6.1.1,<7.0.0 pyfakefs>=5.4.1,<6.0.0 -pylama>=8.4.0,<9.0.0 pylint>=3.0.0,<4.0.0 pytest-asyncio>=0.17.0,<1.0.0 pytest-cov>=3.0.0,<5.0.0 @@ -14,5 +12,4 @@ pytest>=7.0.0,<8.0.0 scrapli-cfg==2023.7.30 scrapli-replay==2023.7.30 toml>=0.10.2,<1.0.0 -types-paramiko>=2.8.6,<4.0.0 -types-pkg-resources>=0.1.3,<1.0.0 \ No newline at end of file +types-paramiko>=2.8.6,<4.0.0 \ No newline at end of file diff --git a/scrapli/channel/base_channel.py b/scrapli/channel/base_channel.py index f0d8ba0d..8da79e13 100644 --- a/scrapli/channel/base_channel.py +++ b/scrapli/channel/base_channel.py @@ -415,7 +415,7 @@ def _join_and_compile(channel_outputs: Optional[List[bytes]]) -> Pattern[bytes]: return regex_channel_outputs_pattern - def _ssh_message_handler(self, output: bytes) -> None: # noqa: C901 + def _ssh_message_handler(self, output: bytes) -> None: # pylint:disable=too-many-branches """ Parse EOF messages from _pty_authenticate and create log/stack exception message diff --git a/scrapli/driver/base/base_driver.py b/scrapli/driver/base/base_driver.py index d06b9433..f25457f9 100644 --- a/scrapli/driver/base/base_driver.py +++ b/scrapli/driver/base/base_driver.py @@ -1,4 +1,4 @@ -"""scrapli.driver.base.base_driver""" # noqa: C0302 +"""scrapli.driver.base.base_driver""" # pylint:disable=too-many-lines import importlib from dataclasses import fields