epythet.validation.lint¶
Level 0: static docstring linters, normalised into the finding model.
Two tools are shelled out to. ruff check --select D covers pydocstyle
(presence, summary lines, section formatting for the configured convention).
pydoclint covers signature consistency (DOC1xx/DOC2xx/DOC4xx/
DOC5xx: undocumented or misnamed parameters, missing returns), which ruff
only previews a handful of; it is optional and skipped with a note when it is
not installed.
Findings keep the tool’s own code as rule (D102, DOC101) and name
the tool in tool, so they never collide with ledger ids.
Module Attributes
Docstring styles ruff's pydocstyle convention and pydoclint's |
|
|
|
types live in annotations, never in the docstring. |
Functions
|
|
|
|
|
Level 0: ruff D plus pydoclint, with notes for anything skipped. |
|
Run |
|
Run |
- epythet.validation.lint.PYDOCLINT_OPTIONS = ('--quiet', '--skip-checking-short-docstrings', 'true', '--arg-type-hints-in-docstring', 'false', '--arg-type-hints-in-signature', 'true', '--check-return-types', 'false', '--check-yield-types', 'false')¶
types live in annotations, never in the docstring.
--arg-type-hints-in-signature truetells pydoclint that is how a documented signature looks (DOC108 fires on the opposite reading:falsemeans “expect no type hints in the signature”, which trips on every annotated function).--arg-type-hints-in-docstring falsekeeps it from asking for types in the docstring text.--allow-init-docstringdefaults toFalse, which enforces DOC301 (__init__undocumented, its Args merged into the class docstring) – the convention this house already writes to, so it is left at its default rather than passed explicitly.- Type:
pydoclint options for the house convention
- epythet.validation.lint.RUFF_D_IGNORE = ('D107',)¶
D107(__init__must have its own docstring) contradicts pydoclint’sDOC301(__init__must NOT have one; its Args merge into the class docstring) – the house convention this repo’s docstring-style skill already documents. Only one side can pass, so the ruff side is dropped.
- epythet.validation.lint.STYLES = ('google', 'numpy', 'sphinx')¶
Docstring styles ruff’s pydocstyle convention and pydoclint’s
--styleboth accept.
- epythet.validation.lint.pydoclint_severity(code)[source]¶
DOC1xx(arguments disagree with the signature) are warnings; the rest info.- Return type:
>>> pydoclint_severity("DOC101"), pydoclint_severity("DOC201") ('warning', 'info')
- epythet.validation.lint.ruff_severity(code)[source]¶
D1xx(missing docstrings) are warnings; otherDrules are style, so info.- Return type:
>>> ruff_severity("D102"), ruff_severity("D205") ('warning', 'info')
- epythet.validation.lint.run_lint_level(package_dir, *, project_dir, style='google', ignore=())[source]¶
Level 0: ruff D plus pydoclint, with notes for anything skipped.
ignoreis the--ignorelist every other level applies at file discovery; the linters walk the package themselves, so their findings are filtered by the same predicate (is_ignored()) on the file’s full path.