Skip to content

Commit 3c9d4cb

Browse files
gencurrentshaypal5
authored andcommitted
chore: bump docformatter to v1.7.8
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 introduced stricter docstring formatting decisions that conflict with ruff-format on a few patterns: - 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. Includes docstring rewrapping in 4 files (core.py, cores/base.py, conftest.py, test_general.py) that v1.7.8's defaults now produce. test_general.py also has misplaced docstring-style strings inside function bodies converted to `#` comments to fix oscillation with ruff-format.
1 parent ce16a58 commit 3c9d4cb

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

.pre-commit-config.yaml

Lines changed: 10 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,20 @@ 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+
# (see PyCQA/docformatter#354). Exclude until upstream reconciles
40+
# the conventions or the patterns are restructured.
41+
exclude: |
42+
(?x)^(
43+
src/cachier/exporters/prometheus\.py|
44+
tests/mongo_tests/clients\.py|
45+
tests/test_varargs\.py
46+
)$
4447
4548
- repo: https://github.com/executablebooks/mdformat
4649
rev: 1.0.0

0 commit comments

Comments
 (0)