Repository navigation
Adopt ruff 0.16 with autofixable rule families - #103
Merged
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
Summary
Ruff 0.16 expanded its default rule set from 59 to 413 rules (release notes), which flagged ~860 issues in
pyenzyme/andtests/. This PR adopts only the rule families ruff can fix itself, then bumps the pinned version.pyproject.toml: new[tool.ruff]configselect = ["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__, unusednoqa)extend-exclude:pyenzyme/versions/v2.py(generated by md-models, "do not edit") andpyenzyme/v1(legacy)ruff check --fixacross 43 files (mechanical). The two unsafe UP031 fixes inpyenzyme/logging.pywere reviewed by hand: they turn%formatting into f-strings and escape loguru's{module}/{level}placeholders correctly.lint.ymlsteps and.pre-commit-config.yaml. Both pick up the new config frompyproject.toml; pre-commit's--force-excluderespects the exclude.Test plan
ruff check pyenzyme tests(0.16.10): all checks passeduv run --all-extras pytest -m "not remote": 101 passed🤖 Generated with Claude Code
This change is