Skip to content

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
masterfrom
mergify/bp/master/pr-568
Open

chore(ruff): ignore B904 and fix format drift so pre-commit passes on a clean checkout (backport #568)#570
mergify[bot] wants to merge 2 commits into
masterfrom
mergify/bp/master/pr-568

Conversation

@mergify

@mergify mergify Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

develop does not currently pass its own pre-commit hooks. On a fresh clone with the pinned ruff (0.13.1):

  • ruff fails with one B904 in agent/site.py (~line 1318)
  • ruff format rewrites agent/site.py as soon as anyone stages it

Both came in with #553, which appears to have been committed with hooks skipped. The practical effect is that the next person to touch site.py either drags unrelated reformatting into their diff or has to --no-verify.

Changes

  1. ruff.toml — add B904 to lint.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.
  2. agent/database_physical_backup.py — drop the now-redundant # noqa: B904 (otherwise RUF100 fires).
  3. agent/site.pyruff format, separate commit. Whitespace only, no behaviour change.

After this, ruff check agent/ and ruff format --check agent/ are both clean.

If you'd rather keep B904 enforced, the alternative is a one-word fix — raise AgentException(...) from None at agent/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.

balamurali27 and others added 2 commits July 29, 2026 10:38
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)
Pre-existing drift from #553 — the file was committed without the
formatter hook, so `ruff format` rewrites it the moment anyone else
stages it. Whitespace only, no behaviour change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 203eafe)
@mergify

mergify Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

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