From 54b41eeb94e63683171f41caa5839c6b1df82849 Mon Sep 17 00:00:00 2001 From: "Bradley A. Thornton" Date: Tue, 28 May 2024 09:13:05 -0700 Subject: [PATCH] Remove useless supressions --- .config/constraints.txt | 6 +++++- .config/requirements-test.in | 1 + .vscode/settings.json | 1 + pyproject.toml | 5 ++++- src/ansible_dev_environment/arg_parser.py | 1 - src/ansible_dev_environment/subcommands/inspector.py | 1 - src/ansible_dev_environment/subcommands/installer.py | 1 - src/ansible_dev_environment/subcommands/lister.py | 1 - src/ansible_dev_environment/subcommands/treemaker.py | 1 - src/ansible_dev_environment/tree.py | 1 - src/ansible_dev_environment/utils.py | 1 - 11 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.config/constraints.txt b/.config/constraints.txt index ab08495..3c4c985 100644 --- a/.config/constraints.txt +++ b/.config/constraints.txt @@ -5,6 +5,7 @@ # pip-compile --all-extras --no-annotate --output-file=.config/constraints.txt --strip-extras .config/requirements.in pyproject.toml # ansible-builder==3.0.1 +astroid==3.2.2 attrs==23.2.0 babel==2.15.0 beautifulsoup4==4.12.3 @@ -21,10 +22,11 @@ chardet==5.2.0 charset-normalizer==3.3.2 click==8.1.7 colorama==0.4.6 -coverage==7.5.2 +coverage==7.5.3 csscompressor==0.9.5 cssselect2==0.7.0 defusedxml==0.7.1 +dill==0.3.8 distlib==0.3.8 distro==1.9.0 dnspython==2.6.1 @@ -39,6 +41,7 @@ htmlmin2==0.1.13 identify==2.5.36 idna==3.7 iniconfig==2.0.0 +isort==5.13.2 jinja2==3.1.4 jsmin==3.0.1 jsonschema==4.22.0 @@ -82,6 +85,7 @@ pycparser==2.22 pydoclint==0.4.1 pyflakes==3.2.0 pygments==2.18.0 +pylint==3.2.2 pymdown-extensions==10.8.1 pyproject-api==1.6.1 pyproject-hooks==1.1.0 diff --git a/.config/requirements-test.in b/.config/requirements-test.in index b50ad02..835b0f8 100644 --- a/.config/requirements-test.in +++ b/.config/requirements-test.in @@ -5,6 +5,7 @@ mypy pip-tools pre-commit pydoclint[flake8] +pylint pytest pytest-xdist ruff diff --git a/.vscode/settings.json b/.vscode/settings.json index 9973676..62ee646 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -15,6 +15,7 @@ "mypy-type-checker.args": ["--config-file=${workspaceFolder}/pyproject.toml"], "mypy-type-checker.importStrategy": "fromEnvironment", "mypy-type-checker.reportingScope": "workspace", + "pylint.importStrategy": "fromEnvironment", "python.testing.pytestArgs": ["tests"], "python.testing.pytestEnabled": true, "python.testing.unittestEnabled": false diff --git a/pyproject.toml b/pyproject.toml index 9c77209..dd5728b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -295,7 +295,10 @@ disable = [ "too-many-instance-attributes" ] enable = [ - "useless-suppression" # Identify unneeded pylint disable statements + "useless-suppression" +] +fail-on = [ + "useless-suppression" ] [tool.pytest.ini_options] diff --git a/src/ansible_dev_environment/arg_parser.py b/src/ansible_dev_environment/arg_parser.py index 67bfe6e..692e62a 100644 --- a/src/ansible_dev_environment/arg_parser.py +++ b/src/ansible_dev_environment/arg_parser.py @@ -200,7 +200,6 @@ def parse() -> argparse.Namespace: help="Uninstall a collection.", ) - # pylint: disable=protected-access for grp in parser._action_groups: # noqa: SLF001 if grp.title is None: continue diff --git a/src/ansible_dev_environment/subcommands/inspector.py b/src/ansible_dev_environment/subcommands/inspector.py index 4e213be..81af182 100644 --- a/src/ansible_dev_environment/subcommands/inspector.py +++ b/src/ansible_dev_environment/subcommands/inspector.py @@ -36,7 +36,6 @@ def __init__(self: Inspector, config: Config, output: Output) -> None: def run(self: Inspector) -> None: """Run the Inspector.""" - # pylint: disable=too-many-locals collections = collect_manifests( target=self._config.site_pkg_collections_path, venv_cache_dir=self._config.venv_cache_dir, diff --git a/src/ansible_dev_environment/subcommands/installer.py b/src/ansible_dev_environment/subcommands/installer.py index 8721122..0bb9677 100644 --- a/src/ansible_dev_environment/subcommands/installer.py +++ b/src/ansible_dev_environment/subcommands/installer.py @@ -382,7 +382,6 @@ def _install_local_collection( Raises: RuntimeError: If tarball is not found or if more than one tarball is found. """ - # pylint: disable=too-many-instance-attributes msg = f"Installing local collection from: {collection.build_dir}" self._output.info(msg) diff --git a/src/ansible_dev_environment/subcommands/lister.py b/src/ansible_dev_environment/subcommands/lister.py index 55e7ef3..1ad5e30 100644 --- a/src/ansible_dev_environment/subcommands/lister.py +++ b/src/ansible_dev_environment/subcommands/lister.py @@ -31,7 +31,6 @@ def run(self: Lister) -> None: Raises: TypeError: If the link is not a string. """ - # pylint: disable=too-many-locals collections = collect_manifests( target=self._config.site_pkg_collections_path, venv_cache_dir=self._config.venv_cache_dir, diff --git a/src/ansible_dev_environment/subcommands/treemaker.py b/src/ansible_dev_environment/subcommands/treemaker.py index 70b8841..35970e8 100644 --- a/src/ansible_dev_environment/subcommands/treemaker.py +++ b/src/ansible_dev_environment/subcommands/treemaker.py @@ -35,7 +35,6 @@ def run(self: TreeMaker) -> None: # noqa: C901, PLR0912, PLR0915 Raises: TypeError: If the tree dict is not a dict. """ - # pylint: disable=too-many-locals builder_introspect(self._config, self._output) with self._config.discovered_python_reqs.open("r") as reqs_file: diff --git a/src/ansible_dev_environment/tree.py b/src/ansible_dev_environment/tree.py index da404ef..b4edf6b 100644 --- a/src/ansible_dev_environment/tree.py +++ b/src/ansible_dev_environment/tree.py @@ -119,7 +119,6 @@ def _print_tree( # noqa: C901, PLR0913, PLR0912 Raises: TypeError: If the object is not a dict, list, or scalar """ - # pylint: disable=R0914 if isinstance(obj, dict): for i, (key, value) in enumerate(obj.items()): is_last = i == len(obj) - 1 diff --git a/src/ansible_dev_environment/utils.py b/src/ansible_dev_environment/utils.py index e58aee9..cbd35e5 100644 --- a/src/ansible_dev_environment/utils.py +++ b/src/ansible_dev_environment/utils.py @@ -200,7 +200,6 @@ def collect_manifests( # noqa: C901 target: Path, venv_cache_dir: Path, ) -> dict[str, dict[str, JSONVal]]: - # pylint: disable=too-many-locals """Collect manifests from a target directory. Args: