Skip to content

ci(pre-commit): add docformatter hook with tomli dependency - #2553

Merged
Borda merged 10 commits into
developfrom
lint/docformatter
Sep 8, 2026
Merged

Borda merged 10 commits into
developfrom
lint/docformatter

Conversation

@Borda

@Borda Borda commented Sep 8, 2026

Copy link
Copy Markdown
Member

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 the docformatter tool to the pre-commit setup and its configuration in the project settings.

Tooling and configuration updates:

  • Added the docformatter pre-commit hook to .pre-commit-config.yaml for automatic docstring formatting, along with a dependency on tomli.
  • Added a [tool.docformatter] section to pyproject.toml with options for recursive formatting, summary and description wrapping at 88 characters, closing quotes on a new line, and enforcing a new line before summaries.

@Borda
Borda requested a lite review from Copilot September 8, 2026 16:32
@Borda
Borda requested a review from SkalskiP as a code owner September 8, 2026 16:32
@Borda Borda added the enhancement New feature or request label Sep 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 docformatter pre-commit hook pinned to v1.7.8, including a tomli>=2.0.1 extra dependency (needed for reading pyproject.toml config 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.

Borda and others added 6 commits September 8, 2026 18:42
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

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 88%. Comparing base (fb6f6a2) to head (a946223).

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Borda
Borda merged commit 79c45d6 into develop Sep 8, 2026
40 checks passed
@Borda
Borda deleted the lint/docformatter branch September 8, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants