fix(lint): resolve all 78 ruff violations (CI run #8) - #3
Draft
Sbussiso wants to merge 1 commit into
Draft
Conversation
CI run #8 (31141207939) failed at the Lint (ruff) step with 78 errors across src/ and tests/. This fixes all of them: Source files: - E501 (line >120): wrapped long lines in server.py, jobs.py, cli/app.py, store.py, unsloth_readiness.py, github.py, exporters.py, columns.py, ui/jobs.py, curation.py (split Turkish/Indonesian/Vietnamese stopword sets across lines). - RUF001 (ambiguous unicode): replaced cosmetic EN DASH with ASCII hyphen in templates.py histogram labels. Preserved functional unicode with `# noqa` — the RIGHT SINGLE QUOTE in readiness.py _SENTENCE_ENDERS (sentence-ending detection) and the KATAKANA DOUBLE HYPHEN in curation.py Japanese regex range (script detection boundary). - SIM103: collapsed if/return-True/return-False to direct returns in readiness.py. - E401/I001/F541/RUF022/SIM114: applied via ruff --fix (split imports, sorted __all__, removed extraneous f-prefix, merged if-branches). Test files: - E501: added `# noqa: E501` to long test fixture lines (Message/Row constructors, dict literals) where wrapping would hurt readability. - RUF001: added `# noqa: RUF001` to intentional unicode test data in test_transforms.py — these verify mojibake repair (a^EUR(TM) -> ') and CJK fullwidth preservation, so the unicode characters are the point. - RUF015: replaced `[n for n in ... if ...][0]` with `next(...)`. - E741: renamed ambiguous variable `l` to `line`. - RUF059: renamed unused unpacked `report` to `_report`. All 1137 unit tests pass. `ruff check src/ tests/` is clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root Cause
CI run #8 (31141207939) failed at the Lint (ruff) step with 78 errors. The
test (3.12)job failed first, which canceled the 3.11 and 3.13 matrix jobs (fail-fast).Errors Fixed
# noqa: E501for test fixtures# noqafor functional/test unicodeif X: return True; return False→return X__all__(ruff --fix)[...][0]→next(...)l→linereport→_reportKey Design Decisions
# noqa: The RIGHT SINGLE QUOTE inreadiness.py:_SENTENCE_ENDERS(sentence-ending detection) and the KATAKANA DOUBLE HYPHEN incuration.pyJapanese regex range (script detection) are functional — replacing them would break behavior.# noqa:test_transforms.pycontains intentional unicode (curly quotes, fullwidth CJK punctuation) that verifies mojibake repair and CJK preservation. Replacing the characters would defeat the tests' purpose."0–128"→"0-128") was purely visual — safe to replace with ASCII.Verification
ruff check src/ tests/— All checks passedpytest tests/unit/— 1137 passed