Ruff 0.16 compatibility - #374
Conversation
Restores the circular-import-tolerant aliased facade imports that the PLR0402 auto-fix rewrote, with a per-file ignore documenting why.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #374 +/- ##
==========================================
+ Coverage 47.77% 47.92% +0.14%
==========================================
Files 159 159
Lines 10758 10757 -1
==========================================
+ Hits 5140 5155 +15
+ Misses 5618 5602 -16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
Bumps ruff 0.15.20 → 0.16.1 and makes the codebase clean under 0.16's expanded default rule set (59 → 413 default rules), which was breaking lint CI on any PR that advanced the lockfile (#369, #372). All 271 new violations are resolved by conforming to the new defaults, with two deliberate exceptions below.
Rule exclusions
import pooltool.x as xaliasing. The rule's "safe" autofix rewrote these tofrom pooltool import x, which brokeimport pooltooloutright — the facade's aliased statement order controls package initialization and tolerates the pre-existingsystem.render↔evolution.continuousimport cycle via the sys.modules fallback.pooltool/utils/strenum.pyexcluded from ruff entirely: vendored StrEnum backport, kept byte-faithful to upstream (shielded from both lint and format).Notable changes beyond mechanical fixes
BaseMode.keymapclass dicts renamed todefault_keymap: ClassVar[...]with instances copying toself.keymapin__init__(RUF012) — also fixes latent mutation of the shared class dict before the first mode reset.FrictionalInelastic/FrictionalMathavanfriction defaults now useattrs.field(factory=AlciatoreBallBallFriction)instead of sharing one mutable instance across resolvers (RUF009).pocket.center is copy.centerwas missing itsassert(B015).getPos()andcushion.p2).sandbox/scripts kept shebangs and gained the executable bit (EXE001/EXE002/EXE005).pdb.set_trace()is kept as a feature behindnoqa: T100; two UI/config boundary catch-alls keepexcept Exceptionbehindnoqa: BLE001(the psutil catch was instead narrowed topsutil.Error).Timer.timestamp()now returns tz-aware local time (DTZ006); camera errors raisePoolToolErrorand a bareraise Exception()became a descriptiveValueError(TRY002).__all__lists are isort-sorted with their grouping comments removed (RUF022).Validation
ruff check .andruff format --check .clean under 0.16.1🤖 Generated with Claude Code