Skip to content

Adopt ruff 0.16 with autofixable rule families - #103

Merged
haeussma merged 1 commit into
mainfrom
chore/ruff-0.16
Oct 9, 2026
Merged

haeussma merged 1 commit into
mainfrom
chore/ruff-0.16

Conversation

@haeussma

@haeussma haeussma commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Summary

Ruff 0.16 expanded its default rule set from 59 to 413 rules (release notes), which flagged ~860 issues in pyenzyme/ and tests/. This PR adopts only the rule families ruff can fix itself, then bumps the pinned version.

  • pyproject.toml: new [tool.ruff] config
    • select = ["E4", "E7", "E9", "F", "I", "UP", "RUF010", "RUF022", "RUF100"]: the pre-0.16 defaults plus the autofixable families (import sorting, PEP 585/604 typing, {e!s}, sorted __all__, unused noqa)
    • extend-exclude: pyenzyme/versions/v2.py (generated by md-models, "do not edit") and pyenzyme/v1 (legacy)
  • Code: ruff check --fix across 43 files (mechanical). The two unsafe UP031 fixes in pyenzyme/logging.py were reviewed by hand: they turn % formatting into f-strings and escape loguru's {module}/{level} placeholders correctly.
  • Version bump in sync: ruff 0.16.10 in both lint.yml steps and .pre-commit-config.yaml. Both pick up the new config from pyproject.toml; pre-commit's --force-exclude respects the exclude.

Test plan

  • ruff check pyenzyme tests (0.16.10): all checks passed
  • pre-commit hooks (uv-lock, ruff check) pass
  • uv run --all-extras pytest -m "not remote": 101 passed

🤖 Generated with Claude Code


This change is Reviewable

Ruff 0.16 expanded its default rule set from 59 to 413 rules, which
flagged ~860 issues. Instead of adopting all of them, select the pre-0.16
defaults (E4, E7, E9, F) plus the families ruff can fix itself (I, UP,
RUF010, RUF022, RUF100), and exclude the generated pyenzyme/versions/v2.py
and the legacy pyenzyme/v1 package.

Applied `ruff check --fix`; the two UP031 unsafe fixes in
pyenzyme/logging.py were reviewed by hand (loguru braces correctly
escaped). Bumps ruff to 0.16.10 in both lint.yml steps and pre-commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
py-enzyme Ready Ready Preview Oct 9, 2026 12:50pm UTC

@haeussma
haeussma merged commit ee17c7d into main Oct 9, 2026
8 checks passed
@haeussma
haeussma deleted the chore/ruff-0.16 branch October 9, 2026 13:10

This branch was successfully deployed

1 active deployment
Preview — dede29cd Deployed Oct 9, 2026 by vercel[bot]
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