Skip to content

Fix docstrfmt pre-commit hook failing under click >= 8.2#2102

Open
Labib-Bin-Salam wants to merge 1 commit into
praw-dev:mainfrom
Labib-Bin-Salam:fix-docstrfmt-ci
Open

Fix docstrfmt pre-commit hook failing under click >= 8.2#2102
Labib-Bin-Salam wants to merge 1 commit into
praw-dev:mainfrom
Labib-Bin-Salam:fix-docstrfmt-ci

Conversation

@Labib-Bin-Salam
Copy link
Copy Markdown

Problem

The docstrfmt lint hook currently fails on every PR/CI run (the last green main CI run was 2026-04-27). It crashes during CLI argument parsing, before any file is read:

TypeError: main() missing 1 required positional argument: 'section_adornments'

docstrfmt 2.0.2 (the latest release, pinned here) is incompatible with click >= 8.2. CI runners now install click >= 8.2 by default, so the hook env picks it up and the crash is content-independent — it affects all branches and PRs regardless of their changes.

Fix

Pin click < 8.2 via additional_dependencies on the docstrfmt hook until docstrfmt ships a release compatible with newer click.

Verification

$ pre-commit run docstrfmt --all-files
[INFO] Installing environment for https://github.com/LilSpazJoekp/docstrfmt.
docstrfmt................................................................Passed

Reproduced the crash with click 8.4.x, and confirmed it disappears with click 8.1.x, where docstrfmt formats the codebase cleanly.

docstrfmt 2.0.2's CLI is incompatible with click >= 8.2, raising
"TypeError: main() missing 1 required positional argument:
'section_adornments'" before any file is processed. Since CI runners now
install click >= 8.2 by default, the docstrfmt hook fails on every run.

Pin click to < 8.2 via additional_dependencies on the hook until
docstrfmt ships a compatible release. Verified with
`pre-commit run docstrfmt --all-files` (Passed).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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