chore(ruff): ignore B904 and fix format drift so pre-commit passes on a clean checkout (backport #568) - #570
Open
mergify[bot] wants to merge 2 commits into
Open
chore(ruff): ignore B904 and fix format drift so pre-commit passes on a clean checkout (backport #568)#570mergify[bot] wants to merge 2 commits into
mergify[bot] wants to merge 2 commits into
Conversation
The codebase already opted out of B904 case-by-case with `# noqa`, and it was the only lint violation left on develop — #553 landed a `raise` inside an `except` that trips it, so pre-commit fails on a clean checkout. Ignore the rule in ruff.toml and drop the now-redundant `noqa` in database_physical_backup.py (RUF100). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> (cherry picked from commit 0e46793)
Contributor
Author
|
Tick the box to add this pull request to the merge queue (same as
|
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.
developdoes not currently pass its own pre-commit hooks. On a fresh clone with the pinned ruff (0.13.1):rufffails with oneB904inagent/site.py(~line 1318)ruff formatrewritesagent/site.pyas soon as anyone stages itBoth came in with #553, which appears to have been committed with hooks skipped. The practical effect is that the next person to touch
site.pyeither drags unrelated reformatting into their diff or has to--no-verify.Changes
ruff.toml— addB904tolint.ignore. It was the only lint violation left repo-wide, and the codebase had already opted out of it case-by-case via# noqa: B904.agent/database_physical_backup.py— drop the now-redundant# noqa: B904(otherwiseRUF100fires).agent/site.py—ruff format, separate commit. Whitespace only, no behaviour change.After this,
ruff check agent/andruff format --check agent/are both clean.If you'd rather keep B904 enforced, the alternative is a one-word fix —
raise AgentException(...) from Noneatagent/site.py:1318— and then only commits 2 and 3 are needed. Happy to swap.🤖 Generated with Claude Code
This is an automatic backport of pull request #568 done by Mergify.