Skip to content

tooling: Enable ruff preview rules E231, E275, E301, E305, and W391. #402

@nedseb

Description

@nedseb

Context

Follow-up to #400 which enabled E203, E302, E303. Additional preview rules in the E/W group remain inactive due to explicit-preview-rules = true and would catch issues seen in recent PRs.

Rules to enable

Rule Description Current violations Why
E231 Missing whitespace after , 0 Prevents dense 0,15 in sprite arrays (seen in PR #399 before correction)
E275 Missing whitespace after keyword 0 Catches if(...) / for(...) without space
E301 Blank line between methods 0 Catches class methods with no separator
E305 2 blank lines after function/class definition 5 Symmetric with E302 — catches def foo(): ... \n code with only 1 blank line
W391 Too many newlines at end of file 0 Trailing blank lines cleanup

Fix

Add all five to the explicit select list in pyproject.toml and auto-fix the 5 existing E305 violations (all in example files: wsen-hids/examples/comfort_monitor.py, wsen-hids/examples/dew_point.py, wsen-pads/examples/altitude.py, wsen-pads/examples/pressure_trend.py, wsen-pads/examples/temp_pressure_display.py).

Related

Metadata

Metadata

Assignees

Labels

releasedtoolingDeveloper tooling, build system, hooks

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions