Skip to content

Update pre-commit hooks and ruff configuration - #272

Open
david26694 wants to merge 1 commit into
mainfrom
precommit-config-update
Open

Update pre-commit hooks and ruff configuration#272
david26694 wants to merge 1 commit into
mainfrom
precommit-config-update

Conversation

@david26694

Copy link
Copy Markdown
Owner

Config only, no source changes.

What

  • black v25.1.0 -> v26.5.1, ruff v0.0.261 -> v0.16.3
  • ruff.toml: move extend-select and ignore under the lint namespace, silencing the deprecation warning ruff emits on every run
  • normalise .pre-commit-config.yaml indentation
  • refresh uv.lock

Deliberately not included

Running the updated hooks also reformats source, mainly modernising type annotations (Optional[Any] -> Any | None, dropping Dict/List/Optional imports). That is left to a follow-up so this diff stays reviewable.

Until that follow-up lands, pre-commit run --all-files will report changes.

Known issue this does not fix

black and ruff format disagree about line length in this repo: ruff.toml sets 160, black uses its default of 88. Formatting on save with ruff while pre-commit runs black produces churn in both directions.

The most visible symptom is implicit string concatenation. ruff format joins

return (
    f"{type(self).__name__}: cluster_cols={self.cluster_cols}, "
    f"target={self.target_col}, treatment={self.treatment}"
)

into a single 130-character literal, which fits under 160. black cannot split it again, because merging the two literals removed the concatenation point, and E501 is ignored. So the change is one-way and sticks.

Worth settling separately, by aligning the two line lengths or dropping one of the formatters.

🤖 Generated with Claude Code

- black v25.1.0 -> v26.5.1, ruff v0.0.261 -> v0.16.3
- ruff.toml: move extend-select and ignore under the lint namespace, which
  silences the deprecation warning ruff emits on every run
- normalise .pre-commit-config.yaml indentation
- refresh uv.lock

Config only. Running the updated hooks reformats source as well, mainly
modernising type annotations; that is deliberately left to a follow-up so this
diff stays reviewable. Until then `pre-commit run --all-files` will report
changes.

Note black and ruff format disagree about line length in this repo: ruff.toml
sets 160 while black uses its default of 88. Formatting on save with ruff while
pre-commit runs black produces churn, most visibly by joining multi-line
implicit string concatenations that black then cannot split again.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codecov-commenter

codecov-commenter commented Aug 18, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.17%. Comparing base (b0a737a) to head (9d44145).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #272   +/-   ##
=======================================
  Coverage   95.17%   95.17%           
=======================================
  Files          18       18           
  Lines        2094     2094           
=======================================
  Hits         1993     1993           
  Misses        101      101           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants