Skip to content

chore: ruff auto-fix E303 — too-many-blank-lines - #42036

Closed
wesleysimplicio wants to merge 1 commit into
NousResearch:mainfrom
wesleysimplicio:chore/ruff-E303
Closed

wesleysimplicio wants to merge 1 commit into
NousResearch:mainfrom
wesleysimplicio:chore/ruff-E303

Conversation

@wesleysimplicio

Copy link
Copy Markdown
Contributor

What does this PR do?

Adds the E303 rule to pyproject.toml and applies auto-fix across 210 files.

Removes excess blank lines between function/class definitions, enforcing the PEP 8 convention of at most two blank lines at the top level and at most one blank line inside methods.

Root cause

The codebase accumulated extra blank lines during normal development. PEP 8 (E303) specifies that the maximum blank line count is 2 at the module level and 1 inside functions — this rule enforces that.

Fix

  • Added E303 to [tool.ruff.lint] select in pyproject.toml.
  • Ran ruff check --select E303 --preview --fix . — 375 errors fixed across 210 files.

Why this shape

Same per-rule pattern as the existing ruff PRs (#31825#32027): one rule, one auto-fix, one commit. Keeps diffs focused and blame history clean.

Tests

  • ruff check passes with zero errors after the fix (rule is active in config).
  • No runtime behaviour changed — only blank-line count adjustments.
  • Existing pytest suite continues to pass.

Related PRs / issues

  • Part of the ongoing ruff rule enablement campaign.
  • No competing PRs found for E303.

@wesleysimplicio
wesleysimplicio requested a review from a team June 8, 2026 11:08
@alt-glitch alt-glitch added type/refactor Code restructuring, no behavior change P3 Low — cosmetic, nice to have labels Jun 8, 2026
@austinpickett

Copy link
Copy Markdown
Collaborator

Coordination note (all 4 ruff PRs: #42037, #42036, #42034, #42035)

These four mechanical ruff auto-fixes are all valid — no logic changes, just W391/E303/F541/PIE807 cleanup. However they share overlapping files and will create merge conflicts if landed independently:

Request: Could you consolidate all four into a single PR (e.g. chore: ruff auto-fix W391/E303/F541/PIE807) so they land atomically? Alternatively, merge them sequentially (smallest-first: #42037#42035#42034#42036) with a rebase between each — but a single combined PR is much cleaner.

Tagging all four: #42037 #42034 #42035

@wesleysimplicio

Copy link
Copy Markdown
Contributor Author

Closing in favor of consolidated PR (per austinpickett's review request — see consolidated PR replacing this one.)

@wesleysimplicio
wesleysimplicio deleted the chore/ruff-E303 branch June 12, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have type/refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants