Skip to content

style: format the code base with ruff and check it in CI - #313

Merged
Ramdam17 merged 5 commits into
masterfrom
chore/ruff-format
Oct 4, 2026
Merged

Ramdam17 merged 5 commits into
masterfrom
chore/ruff-format

Conversation

@Ramdam17

@Ramdam17 Ramdam17 commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator

This pull request formats the whole code base once with ruff format and 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-revs lists 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 vendored hypyp/ext and 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 new lint dependency group, included by dev, and the lock file gains ruff 0.16.10 and nothing else. The CI gets a lint job that runs ruff format --check . and ruff check ..

The second commit is the unedited output of ruff format .: 70 Python files and the Python examples of hypyp/sync/README.md.

The third commit records the second one in .git-blame-ignore-revs, so that git blame skips it. GitHub applies the file automatically; locally, run git config blame.ignoreRevsFile .git-blame-ignore-revs once.

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

Ramdam17 and others added 3 commits October 3, 2026 18:35
…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>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Code review skipped — your organization has no extra usage available to pay for this review.

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.

Ramdam17 and others added 2 commits October 3, 2026 18:45
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>
@Ramdam17
Ramdam17 merged commit 917dc0c into master Oct 4, 2026
10 checks passed
@Ramdam17
Ramdam17 deleted the chore/ruff-format branch October 4, 2026 02:06
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