Skip to content

Commit 92fce34

Browse files
authored
chore: bump docformatter to v1.7.8 (#388)
v1.7.8 drops the unmaintained `untokenize` dependency (replaced by stdlib `tokenize`), which was failing to install on Python 3.12+ runners due to `ast.Constant.s` removal. This unblocks pre-commit.ci without the `ci.skip: [docformatter]` workaround added in #376. v1.7.8 also introduces stricter docstring decisions that conflict with ruff-format on a few patterns (see PyCQA/docformatter#354): - blank lines after docstring-only function bodies (prometheus.py) - blank lines between module docstring and first class (clients.py) - multi-line string literals used as `exec()` arguments that docformatter mistakes for docstrings (test_varargs.py) The 3 affected files are excluded from docformatter via a regex `exclude:` in the hook config until upstream reconciles the conventions or the patterns are restructured. The cosmetic docstring/comment cleanup that v1.7.8's defaults surface on already-conformant files was merged separately in #385.
1 parent c92ee34 commit 92fce34

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

.pre-commit-config.yaml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@ ci:
66
autoupdate_commit_msg: "[pre-commit.ci] pre-commit suggestions"
77
autoupdate_schedule: quarterly
88
# submodules: true
9-
# docformatter v1.7.7 transitively pulls `untokenize`, whose setup.py
10-
# uses `ast.Constant.s` (removed in Python 3.12+) and fails to install
11-
# on pre-commit.ci's runners. The `pre-commit` GitHub Actions job still
12-
# runs docformatter, so coverage isn't lost. Remove this once docformatter
13-
# ships v1.7.8 (which drops the untokenize dep).
14-
skip: [docformatter]
159

1610
repos:
1711
- repo: https://github.com/pre-commit/pre-commit-hooks
@@ -36,11 +30,23 @@ repos:
3630
args: []
3731

3832
- repo: https://github.com/PyCQA/docformatter
39-
rev: v1.7.7
33+
rev: v1.7.8
4034
hooks:
4135
- id: docformatter
4236
additional_dependencies: [tomli]
4337
args: ["--in-place"]
38+
# docformatter v1.7.8 disagrees with ruff-format on these files
39+
# (blank lines after docstring-only function bodies, blank lines
40+
# between module docstring and first class, and a multi-line
41+
# string literal used as an `exec()` argument that docformatter
42+
# incorrectly treats as a docstring). Exclude until upstream
43+
# reconciles the conventions or the patterns are restructured.
44+
exclude: |
45+
(?x)^(
46+
src/cachier/exporters/prometheus\.py|
47+
tests/mongo_tests/clients\.py|
48+
tests/test_varargs\.py
49+
)$
4450
4551
- repo: https://github.com/executablebooks/mdformat
4652
rev: 1.0.0

0 commit comments

Comments
 (0)