Skip to content

chore: restore a green pre-commit run - #382

Open
Eljees wants to merge 1 commit into
PyCQA:masterfrom
Eljees:chore/green-precommit-run
Open

chore: restore a green pre-commit run#382
Eljees wants to merge 1 commit into
PyCQA:masterfrom
Eljees:chore/green-precommit-run

Conversation

@Eljees

@Eljees Eljees commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Run linters on code base fails on master itself (run on d5c7b77), so no pull request in this repository gets a usable signal out of that job. Three hooks are red.

pydocstyle - src/docformatter/classify.py:481

D301: Use r""" if any backslashes in a docstring

_is_blank_line spells out "\n" and " \n" in its docstring, so it needs an r-string. That one is mine, from #369 - sorry. The rendered text does not change: "\\n" in a plain docstring and "\n" in a raw one are the same two characters.

mypy - src/docformatter/configuration.py:46

error: Incompatible types in assignment (expression has type "None", variable has type Module)  [assignment]

The ImportError fallback from #371 assigns None to a name mypy has already bound to a module. A targeted # type: ignore[assignment] is the usual spelling for an optional import. I first tried declaring tomllib: Optional[ModuleType] above the try, which mypy accepts, but that puts a statement ahead of from docformatter import __pkginfo__ and ruff then reports E402.

end-of-file-fixer - CHANGELOG.md carries three trailing blank lines.

One thing worth flagging: CHANGELOG.md is regenerated by heinrichreimer/github-changelog-generator-action in do-release.yml and pushed straight to master by EndBug/add-and-commit, so it never passes through pre-commit and those blank lines will come back at the next release. If you would rather not re-strip them every time, adding CHANGELOG.md to exclude: in .pre-commit-config.yaml would settle it for good - happy to do that here instead, whichever you prefer.

Checked against the pinned hook versions - pydocstyle 6.3.0, mypy 1.20.1, black 26.3.1, isort 8.0.1, ruff 0.15.11, eradicate 3.0.1 and docformatter's own hook all come back clean. pytest tests/ is 509 passed, 4 skipped, identical to master.

pydocstyle D301 on _is_blank_line, mypy on the tomllib ImportError
fallback, and end-of-file-fixer on CHANGELOG.md all fail on master, so
the "Run linters on code base" job is red for every pull request.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant