diff --git a/.config/requirements-test.in b/.config/requirements-test.in index b697209..b50ad02 100644 --- a/.config/requirements-test.in +++ b/.config/requirements-test.in @@ -1,9 +1,10 @@ black coverage[toml] +flake8 mypy pip-tools pre-commit -pydoclint +pydoclint[flake8] pytest pytest-xdist ruff diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..f9f5627 --- /dev/null +++ b/.flake8 @@ -0,0 +1,11 @@ +[flake8] +allow-init-docstring = True +arg-type-hints-in-docstring = False +check-return-types = False +select = DOC +show-filenames-in-every-violation-message = True +skip-checking-short-docstrings = False +filename = + */src/**/*.py + */tests/**/*.py +style = google diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 211d0a1..e6fec98 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -70,12 +70,13 @@ repos: - id: cspell name: Spell check with cspell - - repo: https://github.com/jsh9/pydoclint - rev: 0.4.1 + - repo: https://github.com/pycqa/flake8 + rev: 7.0.0 hooks: - - id: pydoclint - args: - - "--config=pyproject.toml" + - id: flake8 + name: flake8(pydoclint) + additional_dependencies: + - pydoclint[flake8] - repo: https://github.com/pycqa/pylint.git rev: v3.1.0 diff --git a/.vscode/extensions.json b/.vscode/extensions.json index d26386e..cee1241 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -5,6 +5,7 @@ "markis.code-coverage", "ms-python.black-formatter", "ms-python.debugpy", + "ms-python.flake8", "ms-python.mypy-type-checker", "ms-python.pylint", "ms-python.python", diff --git a/.vscode/settings.json b/.vscode/settings.json index fd3be0f..2a696ed 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -10,6 +10,7 @@ "editor.defaultFormatter": "ms-python.black-formatter", "editor.formatOnSave": true }, + "flake8.importStrategy": "fromEnvironment", "markiscodecoverage.searchCriteria": "coverage.lcov", "mypy-type-checker.args": ["--config-file=${workspaceFolder}/pyproject.toml"], "mypy-type-checker.importStrategy": "fromEnvironment", diff --git a/pyproject.toml b/pyproject.toml index b14d16a..e0dd50b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,14 +60,6 @@ concurrency = ["multiprocessing", "thread"] files = ["src", "tests"] strict = true -[tool.pydoclint] -allow-init-docstring = true -arg-type-hints-in-docstring = false -check-return-types = false -show-filenames-in-every-violation-message = true -skip-checking-short-docstrings = false -style = 'google' - [tool.pylint] [tool.pylint.format] @@ -337,7 +329,7 @@ lines-between-types = 1 # Separate import/from with 1 line "_version.py" = ["SIM108"] [tool.ruff.lint.pydocstyle] -convention = "pep257" +convention = "google" [tool.setuptools.dynamic] dependencies = {file = [".config/requirements.in"]} diff --git a/src/ansible_dev_environment/subcommands/installer.py b/src/ansible_dev_environment/subcommands/installer.py index b7c36ff..9bcd615 100644 --- a/src/ansible_dev_environment/subcommands/installer.py +++ b/src/ansible_dev_environment/subcommands/installer.py @@ -253,6 +253,7 @@ def _find_files_using_git_ls_files( Args: local_repo_path: The collection local path. + Returns: string with the command used to list files or None string containing a list of files or nothing @@ -284,6 +285,7 @@ def _find_files_using_ls( Args: local_repo_path: The collection local path. + Returns: string with the command used to list files or None string containing a list of files or nothing diff --git a/src/ansible_dev_environment/utils.py b/src/ansible_dev_environment/utils.py index fcf7994..7ad35e8 100644 --- a/src/ansible_dev_environment/utils.py +++ b/src/ansible_dev_environment/utils.py @@ -338,6 +338,7 @@ def collections_meta(config: Config) -> dict[str, dict[str, Any]]: Args: config: The configuration object. + Returns: A dictionary of metadata about installed collections. """ diff --git a/tests/unit/conftest.py b/tests/unit/conftest.py index a799f06..194a550 100644 --- a/tests/unit/conftest.py +++ b/tests/unit/conftest.py @@ -20,6 +20,7 @@ def output(tmp_path: Path) -> Output: Args: tmp_path: Temporary directory. + Returns: Output: Output class object. """