Repository navigation
ci(pre-commit): add docformatter hook with tomli dependency - #2553
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The changes are limited to pre-commit/tool configuration and appear consistent with the repository’s existing formatting and tooling setup.
Pull request overview
This PR updates the repository’s developer tooling by adding docformatter to the pre-commit pipeline and introducing a corresponding [tool.docformatter] configuration block in pyproject.toml, enabling consistent automatic docstring formatting across the codebase.
Changes:
- Added a
docformatterpre-commit hook pinned tov1.7.8, including atomli>=2.0.1extra dependency (needed for readingpyproject.tomlconfig on Python <3.11). - Added
[tool.docformatter]settings to control wrapping and docstring-quote formatting behavior (88-char wrapping, close quotes on newline, pre-summary newline, recursive mode).
File summaries
| File | Description |
|---|---|
pyproject.toml |
Adds docformatter configuration so formatting behavior is consistent and version-controlled. |
.pre-commit-config.yaml |
Adds the docformatter hook (with tomli) so docstring formatting is enforced via pre-commit. |
Review details
- Files reviewed: 114/114 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…e style and punctuation
Changes: - Generate the CV2 import-blocker fixture from explicit Python source lines so the subprocess receives valid code. - Keep Gemini mask fixture base64 payloads as adjacent string literals so JSON values contain no formatter-introduced whitespace. Impact: - Restores the CV2 fallback integration test and two Gemini 2.5 mask cases across the CI matrix. - Lets docformatter and Ruff format the fixtures without changing their executable payloads. Verification: - uv run --frozen pytest src/ tests/ --cov=supervision --cov-report=xml — 3868 passed. - uv run --frozen pre-commit run --all-files — passed. Residual limits: - Remote CI matrix has not been rerun. --- Co-authored-by: Codex <codex@openai.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #2553 +/- ##
=======================================
Coverage 88% 88%
=======================================
Files 85 85
Lines 12223 12223
=======================================
Hits 10760 10760
Misses 1463 1463 🚀 New features to boost your workflow:
|
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.
This pull request introduces a new pre-commit hook and configuration for automatic formatting of Python docstrings using
docformatter. The main changes are the addition of thedocformattertool to the pre-commit setup and its configuration in the project settings.Tooling and configuration updates:
docformatterpre-commit hook to.pre-commit-config.yamlfor automatic docstring formatting, along with a dependency ontomli.[tool.docformatter]section topyproject.tomlwith options for recursive formatting, summary and description wrapping at 88 characters, closing quotes on a new line, and enforcing a new line before summaries.