Skip to content

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

Merged
nedseb merged 1 commit intomainfrom
tooling/ruff-preview-round2
Apr 16, 2026
Merged

tooling: Enable ruff preview rules E231, E275, E301, E305, and W391.#403
nedseb merged 1 commit intomainfrom
tooling/ruff-preview-round2

Conversation

@nedseb
Copy link
Copy Markdown
Contributor

@nedseb nedseb commented Apr 16, 2026

Summary

Second round of explicit preview rules, following #400 (E203/E302/E303).

Rule Description Violations fixed
E231 Missing whitespace after , 0 (prevention)
E275 Missing whitespace after keyword 0 (prevention)
E301 Blank line between methods 0 (prevention)
E305 2 blank lines after function/class definition 5 (auto-fixed)
W391 Too many newlines at end of file 0 (prevention)

The 5 E305 violations were in example files (wsen-hids, wsen-pads) where a function definition was followed by module-level code with only 1 blank line.

Test plan

  • make lint passes
  • make test-mock passes (364 passed, 2 skipped)

Closes

#402

Closes #402.

Second round of explicit preview rules, following #400 (E203/E302/E303):

  E231 — missing whitespace after comma (prevents dense 0,15 in arrays)
  E275 — missing whitespace after keyword (catches if(...) without space)
  E301 — blank line between methods in a class
  E305 — 2 blank lines after function/class definition (symmetric with E302)
  W391 — too many newlines at end of file

Auto-fixed the 5 existing E305 violations, all in example files.
Copilot AI review requested due to automatic review settings April 16, 2026 20:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Enables additional Ruff preview rules for whitespace/blank-line enforcement and updates example scripts to comply with the newly enabled E305 rule.

Changes:

  • Added explicit Ruff preview rules: E231, E275, E301, E305, and W391 in pyproject.toml.
  • Auto-fixed existing E305 violations by inserting an extra blank line after top-level function definitions in affected example files.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pyproject.toml Enables additional explicit Ruff preview rules for whitespace/blank-line enforcement.
lib/wsen-pads/examples/temp_pressure_display.py Adds a missing blank line after a top-level function to satisfy E305.
lib/wsen-pads/examples/pressure_trend.py Adds a missing blank line after a top-level function to satisfy E305.
lib/wsen-pads/examples/altitude.py Adds a missing blank line after a top-level function to satisfy E305.
lib/wsen-hids/examples/dew_point.py Adds a missing blank line after a top-level function to satisfy E305.
lib/wsen-hids/examples/comfort_monitor.py Adds a missing blank line after a top-level function to satisfy E305.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nedseb nedseb merged commit d777443 into main Apr 16, 2026
14 checks passed
@nedseb nedseb deleted the tooling/ruff-preview-round2 branch April 16, 2026 20:32
@semantic-release-updater
Copy link
Copy Markdown

🎉 This PR is included in version 0.23.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants