Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop flake8 but keep using pydoclint #277

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .config/pydoclint-baseline.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
src/ansible_dev_tools/arg_parser.py
DOC203: Function `parse` return type(s) in docstring not consistent with the return annotation. Return annotation types: ['argparse.Namespace']; docstring return section types: ['']
--------------------
src/ansible_dev_tools/cli.py
DOC301: Class `Cli`: __init__() should not have a docstring; please combine it with the docstring of the class
--------------------
src/ansible_dev_tools/resources/server/creator.py
DOC203: Method `CreatorFrontendV1._response_from_tar` return type(s) in docstring not consistent with the return annotation. Return annotation types: ['FileResponse']; docstring return section types: ['']
DOC203: Method `CreatorFrontendV1.playbook` return type(s) in docstring not consistent with the return annotation. Return annotation types: ['FileResponse | HttpResponse']; docstring return section types: ['']
DOC203: Method `CreatorFrontendV1.collection` return type(s) in docstring not consistent with the return annotation. Return annotation types: ['FileResponse | HttpResponse']; docstring return section types: ['']
DOC301: Class `CreatorOutput`: __init__() should not have a docstring; please combine it with the docstring of the class
DOC301: Class `CreatorBackend`: __init__() should not have a docstring; please combine it with the docstring of the class
DOC203: Method `CreatorBackend.collection` return type(s) in docstring not consistent with the return annotation. Return annotation types: ['Path']; docstring return section types: ['']
DOC203: Method `CreatorBackend.playbook` return type(s) in docstring not consistent with the return annotation. Return annotation types: ['Path']; docstring return section types: ['']
--------------------
src/ansible_dev_tools/server_utils.py
DOC203: Function `validate_request` return type(s) in docstring not consistent with the return annotation. Return annotation types: ['RequestUnmarshalResult | HttpResponse']; docstring return section types: ['']
DOC203: Function `validate_response` return type(s) in docstring not consistent with the return annotation. Return annotation types: ['FileResponse | HttpResponse']; docstring return section types: ['HttpResponse']
--------------------
src/ansible_dev_tools/subcommands/server.py
DOC301: Class `AdtServerApp`: __init__() should not have a docstring; please combine it with the docstring of the class
DOC203: Method `AdtServerApp.load` return type(s) in docstring not consistent with the return annotation. Return annotation types: ['WSGIHandler']; docstring return section types: ['']
DOC301: Class `Server`: __init__() should not have a docstring; please combine it with the docstring of the class
--------------------
src/ansible_dev_tools/utils.py
DOC601: Class `Colors`: Class docstring contains fewer class attributes than actual class attributes. (Please read https://jsh9.github.io/pydoclint/checking_class_attributes.html on how to correctly document class attributes.)
DOC603: Class `Colors`: Class docstring attributes are different from actual class attributes. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Attributes in the class definition but not in the docstring: [BLACK: , BLINK: , BLUE: , BOLD: , BROWN: , CROSSED: , CYAN: , DARK_GRAY: , END: , FAINT: , GREEN: , ITALIC: , LIGHT_BLUE: , LIGHT_CYAN: , LIGHT_GRAY: , LIGHT_GREEN: , LIGHT_PURPLE: , LIGHT_RED: , LIGHT_WHITE: , NEGATIVE: , PURPLE: , RED: , UNDERLINE: , YELLOW: ]. (Please read https://jsh9.github.io/pydoclint/checking_class_attributes.html on how to correctly document class attributes.)
--------------------
11 changes: 0 additions & 11 deletions .flake8

This file was deleted.

26 changes: 15 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,13 @@ repos:
rev: v1.5.5
hooks:
- id: remove-tabs
exclude: >
(?x)^(
.config/pydoclint-baseline.txt
)$

- repo: https://github.com/pycontribs/mirrors-prettier
rev: v3.3.0
rev: v3.3.2
hooks:
- id: prettier
always_run: true
Expand All @@ -55,28 +59,28 @@ repos:
- id: tox-ini-fmt

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.7
rev: v0.4.10
hooks:
- id: ruff
args:
- --exit-non-zero-on-fix

- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v8.8.2
rev: v8.9.0
hooks:
- id: cspell
name: Spell check with cspell

- repo: https://github.com/pycqa/flake8
rev: 7.0.0
- repo: https://github.com/jsh9/pydoclint
rev: 0.5.1
hooks:
- id: flake8
name: flake8(pydoclint)
additional_dependencies:
- pydoclint[flake8]
- id: pydoclint
# This allows automatic reduction of the baseline file when needed.
entry: sh -ec "pydoclint . && pydoclint --generate-baseline=1 ."
pass_filenames: false

- repo: https://github.com/pycqa/pylint.git
rev: v3.2.2
rev: v3.2.3
hooks:
- id: pylint
args:
Expand All @@ -90,7 +94,7 @@ repos:
- pyyaml

- repo: https://github.com/pre-commit/mirrors-mypy.git
rev: v1.10.0
rev: v1.10.1
hooks:
- id: mypy
additional_dependencies:
Expand Down
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ strict = true
ignore_missing_imports = true
module = ["gunicorn.*", "openapi_core.*"]

[tool.pydoclint]
arg-type-hints-in-docstring = false
baseline = ".config/pydoclint-baseline.txt"
exclude = '\.git|\.tox|build'
style = "google"

[tool.pylint]

[tool.pylint.format]
Expand Down Expand Up @@ -319,11 +325,17 @@ verbosity_assertions = 2
[tool.ruff]
builtins = ["__"]
cache-dir = "./.cache/.ruff"
external = [
"DOC" # pydoclint
]
fix = true
line-length = 100
target-version = "py310"

[tool.ruff.lint]
extend-ignore = [
"ANN101" # missing-type-self (deprecated)
]
select = ["ALL"]

[tool.ruff.lint.flake8-pytest-style]
Expand Down
Loading