Skip to content

Standardise ruff configuration - #24

Merged
jonnyspicer merged 2 commits into
mainfrom
chore/standardise-ruff
Aug 11, 2026
Merged

Standardise ruff configuration#24
jonnyspicer merged 2 commits into
mainfrom
chore/standardise-ruff

Conversation

@jonnyspicer

Copy link
Copy Markdown
Contributor

Adds a lint.yml — this repo had no lint CI. Config lives in ruff.toml since there is no pyproject.toml. All 31 violations were auto-fixable.

Adopts a single ruff configuration across the org's Python repos. The config
is the one already in Tower-Finder/backend — the most considered in the org —
so this mostly spreads an existing standard rather than inventing one.

select = ["E", "W", "F", "I", "B", "UP", "S", "SIM"]   # 120 columns

with its documented ignore list (E501 and E402 as deliberate, B008 for
FastAPI's Depends(), the SIM readability rules, and the bandit exceptions).

Pinned to ruff==0.16.2. An unpinned ruff picks up new rules on release
and turns a green branch red without anything in the repo changing. Two repos
had floating constraints (ruff>=0.5, ruff>=0.8.0); both are now pinned.

Verification

Across the ten repos: 240 violations, 220 fixed by ruff --fix, 20 by hand.
Every repo reports All checks passed! under ruff 0.16.2, and every test suite
that runs was run and passes.

The hand fixes were real, not cosmetic — annotation == boolis bool for
type identity, raise ... from e to preserve tracebacks, an unclosed file
handle, and unused loop variables. Where a flagged pattern was deliberate it
got a # noqa with a stated reason rather than a rewrite.

Note on conflicts

feat/gvl-metro-scoping is active across several of these repos. Import
reordering (I001) touches file headers, so expect conflicts there — taking
this branch's version of the import block is almost always right.

🤖 Generated with Claude Code

Adopt the shared offworldlabs ruff standard (E,W,F,I,B,UP,S,SIM at 120
columns, with the documented ignore list from Tower-Finder, which had the
most considered config in the org). Apply ruff's auto-fixes and resolve the
remainder by hand.

Pinned to ruff==0.16.2: an unpinned ruff picks up new rules on release and
turns a green branch red without anything in the repo changing.
Bare 'on: push' alongside 'pull_request' runs the job twice on every PR
commit. Matches the convention in the repos that already had CI.
@jonnyspicer
jonnyspicer merged commit 9bea362 into main Aug 11, 2026
1 check passed
@jonnyspicer
jonnyspicer deleted the chore/standardise-ruff branch August 11, 2026 01:33
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