Skip to content

Commit

Permalink
Enable pydoclint via flake 8 (#165)
Browse files Browse the repository at this point in the history
* Move pydoclint to flake8

* Should be flake8

* Fix intentional error

* Update ruff config to match pydocstyle

* chore: auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
cidrblock and pre-commit-ci[bot] authored May 23, 2024
1 parent 50204a6 commit 6a567b6
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .config/requirements-test.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
black
coverage[toml]
flake8
mypy
pip-tools
pre-commit
pydoclint
pydoclint[flake8]
pytest
pytest-xdist
ruff
Expand Down
11 changes: 11 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -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
11 changes: 6 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 1 addition & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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"]}
Expand Down
2 changes: 2 additions & 0 deletions src/ansible_dev_environment/subcommands/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/ansible_dev_environment/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down
1 change: 1 addition & 0 deletions tests/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def output(tmp_path: Path) -> Output:
Args:
tmp_path: Temporary directory.
Returns:
Output: Output class object.
"""
Expand Down

0 comments on commit 6a567b6

Please sign in to comment.