Repository navigation
style: format the code base with ruff and check it in CI - #313
Merged
Merged
Conversation
…n CI Ruff formats at line length 88 and lints only for certain bugs (E9, F63, F7, F82). The vendored hypyp/ext and the tutorial notebooks are excluded. Ruff lives in a new lint dependency group, included by dev, so that the CI lint job installs nothing else. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Output of `ruff format .` with the configuration of the previous commit and nothing else. The syntax tree of every Python file is unchanged apart from whitespace inside docstrings; the Python examples of hypyp/sync/README.md are formatted too. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
There was a problem hiding this comment.
If your organization's extra usage balance is empty, an organization admin can add extra usage credits at claude.ai/admin-settings/usage. If its monthly spend limit was reached, an admin can raise it on the same page. If neither applies, contact Anthropic support.
Once extra usage is available, someone with write access to this repository can comment @claude review on this pull request to trigger a review.
With --locked the lint job fails clearly if uv.lock is out of date instead of resolving dependencies again. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ruff format replaces it; keeping both would let the two formatters undo each other. The lock file loses black, mypy-extensions and pytokens. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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 formats the whole code base once with
ruff formatand makes the CI keep it that way. It changes no behaviour and no computed value.To be merged with a merge commit, not squashed.
.git-blame-ignore-revslists the hash of the formatting commit, and a squash or a rebase would change that hash.What it contains
The pull request has three commits, meant to be read separately.
The first one configures Ruff in
pyproject.toml: line length 88, the vendoredhypyp/extand the tutorial notebooks excluded. Linting is limited to rules that only catch certain bugs (syntax errors, invalid comparisons and statements, undefined names:E9,F63,F7,F82); the code base already passes them, so no code had to be edited by hand. Ruff comes from a newlintdependency group, included bydev, and the lock file gains ruff 0.16.10 and nothing else. The CI gets alintjob that runsruff format --check .andruff check ..The second commit is the unedited output of
ruff format .: 70 Python files and the Python examples ofhypyp/sync/README.md.The third commit records the second one in
.git-blame-ignore-revs, so thatgit blameskips it. GitHub applies the file automatically; locally, rungit config blame.ignoreRevsFile .git-blame-ignore-revsonce.How it was verified
The syntax tree of each of the 81 Python files was compared before and after formatting. It is identical for 63 files; for the other 18 the only difference is whitespace inside docstrings. The test suite gives 218 passed and 48 skipped on macOS arm64, the same as
master.Left for later
Style rules, unused imports and the like are deliberately not enforced yet; they are tracked for a later clean-up. The tutorial notebooks are not formatted.
🤖 Generated with Claude Code