Skip to content

fix(lint): resolve all ruff violations blocking CI - #7

Draft
Sbussiso wants to merge 1 commit into
masterfrom
ci-fix/31567271618
Draft

fix(lint): resolve all ruff violations blocking CI#7
Sbussiso wants to merge 1 commit into
masterfrom
ci-fix/31567271618

Conversation

@Sbussiso

Copy link
Copy Markdown
Contributor

CI Failure Triage — Run #20 (31567271618)

Root cause: ruff check src/ tests/ reported 97 lint violations, failing the CI lint step before tests could run.

Violations fixed (97 total):

Rule Count Fix
E501 52 Wrapped long lines to ≤120 chars
RUF001 17 En-dashes → ASCII hyphens (labels); noqa for intentional Unicode (mojibake test data, CJK regex, sentence-enders)
F401 1 PatternTimeout was a re-export — added to __all__
SIM103 2 Collapsed if/return True/return False → direct return
SIM102 1 Collapsed nested if → single if a and b
RUF012 2 Mutable list class defaults → tuples (test mocks)
RUF015 2 [x for ...][0]next(x for ...)
RUF059 2 Unused unpacked vars → _-prefixed
E741 2 Ambiguous lline
I001/E401/F541/W292/RUF022 7 Auto-fixed by ruff check --fix

Verification:

  • ruff check src/ tests/All checks passed (ruff 0.15.22, the locked version)
  • pytest tests/1694 passed, 0 failed

Scope: Purely stylistic/structural changes. No logic changes. All test data strings preserved exactly (string concatenation produces identical values).

CI run #20 failed because 'ruff check src/ tests/' reported 97 violations.
This commit fixes all of them:

- E501 (52): wrapped long lines to <=120 chars — string concatenation,
  parenthesized expressions, multi-line dict/call formatting
- RUF001 (17): replaced cosmetic en-dashes in histogram bucket labels
  with ASCII hyphens; added noqa comments for intentional Unicode
  (mojibake test data, CJK regex ranges, sentence-ender sets)
- F401 (1): PatternTimeout was a re-export, not unused — added to __all__
- SIM103 (2): collapsed if/return True/return False into direct return
- SIM102 (1): collapsed nested if into a single if-with-and
- RUF012 (2): mutable list class defaults to tuples in test mock classes
- RUF015 (2): list-comprehension-first-element to next() generator
- RUF059 (2): renamed unused unpacked vars to underscore-prefixed
- E741 (2): ambiguous single-letter 'l' to 'line' in test comprehensions
- I001/E401/F541/W292/RUF022: auto-fixed by 'ruff check --fix'

All 1694 tests pass. Ruff 0.15.22 (locked version) reports clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants