Standardise ruff configuration - #24
Merged
Merged
Conversation
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.
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.
Adds a
lint.yml— this repo had no lint CI. Config lives inruff.tomlsince there is nopyproject.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.
with its documented ignore list (
E501andE402as deliberate,B008forFastAPI's
Depends(), the SIM readability rules, and the bandit exceptions).Pinned to
ruff==0.16.2. An unpinned ruff picks up new rules on releaseand 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 suitethat runs was run and passes.
The hand fixes were real, not cosmetic —
annotation == bool→is boolfortype identity,
raise ... from eto preserve tracebacks, an unclosed filehandle, and unused loop variables. Where a flagged pattern was deliberate it
got a
# noqawith a stated reason rather than a rewrite.Note on conflicts
feat/gvl-metro-scopingis active across several of these repos. Importreordering (
I001) touches file headers, so expect conflicts there — takingthis branch's version of the import block is almost always right.
🤖 Generated with Claude Code