Fix docstrfmt pre-commit hook failing under click >= 8.2#2102
Open
Labib-Bin-Salam wants to merge 1 commit into
Open
Fix docstrfmt pre-commit hook failing under click >= 8.2#2102Labib-Bin-Salam wants to merge 1 commit into
Labib-Bin-Salam wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
docstrfmtlint hook currently fails on every PR/CI run (the last greenmainCI run was 2026-04-27). It crashes during CLI argument parsing, before any file is read:docstrfmt2.0.2 (the latest release, pinned here) is incompatible withclick >= 8.2. CI runners now installclick >= 8.2by 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.2viaadditional_dependencieson thedocstrfmthook untildocstrfmtships a release compatible with newerclick.Verification
Reproduced the crash with
click 8.4.x, and confirmed it disappears withclick 8.1.x, wheredocstrfmtformats the codebase cleanly.