diff --git a/.config/pydoclint-baseline.txt b/.config/pydoclint-baseline.txt new file mode 100644 index 0000000..8672fd7 --- /dev/null +++ b/.config/pydoclint-baseline.txt @@ -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.) +-------------------- diff --git a/.flake8 b/.flake8 deleted file mode 100644 index f9f5627..0000000 --- a/.flake8 +++ /dev/null @@ -1,11 +0,0 @@ -[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 b38a6f5..76a67bc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 @@ -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: @@ -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: diff --git a/pyproject.toml b/pyproject.toml index 0218dd1..fd0fb42 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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] @@ -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]