fix(ruff): ruff 0.16.0 compatibility - #43
Merged
Merged
Conversation
The reusable validate.yml Python-lint step now pins ruff 0.16.0 (netresearch/skill-repo-skill#184). Under 0.16.0 defaults, ruff check . reported 11 findings (no EXE001/FURB105/BLE001 in this repo). Fixes, all behaviour-preserving: - I001, UP035: safe autofix (ruff check --fix --select I001,UP035) -- sorted imports; typing.Iterable -> collections.abc.Iterable. - RUF007 x2: zip(x, x[1:]) -> itertools.pairwise(x) (added import itertools). - PERF102: unused-key dict loop -> .values(). - RUF059 x3: prefixed unused unpacked test locals with _. - DTZ005, DTZ006: # noqa with reason -- naive local time is intentional (cutoff and file mtimes are both naive; adding tz would change the comparison). - SIM115: # noqa with reason -- NamedTemporaryFile(delete=False) path is returned for later use and unlinked by the caller. ruff check . and ruff format --check . clean under 0.16.0; all 76 unit tests pass. Signed-off-by: Sebastian Mendel <github@sebastianmendel.de>
ruff 0.16.0 enables EXE001 by default; the scripts carry a shebang but were tracked 100644. Force 100755 via git plumbing (a WSL/DrvFs exec-bit quirk hid this locally) so CI's fresh checkout clears EXE001. Signed-off-by: Sebastian Mendel <github@sebastianmendel.de>
|
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.



Why
The reusable
validate.ymlPython-lint step now pins ruff 0.16.0 (netresearch/skill-repo-skill#184). Under 0.16.0 defaults,uvx ruff@0.16.0 check .reports 11 findings on this repo, which would fail CI once the pin lands.Note: the expected
EXE001findings do not occur here — the scripts already carry the executable bit (mode100755). The actual findings are import-order, modernization, and lint rules.Findings before (ruff 0.16.0, default config)
typing.Iterable)zippairs)datetime.now()no tz)fromtimestamp()no tz).items()unused key)ruff format --check .was already clean.Fixes (all behaviour-preserving)
ruff check --fix --select I001,UP035) — sorted imports;typing.Iterable→collections.abc.Iterable.zip(x, x[1:])→itertools.pairwise(x)(addedimport itertools)..values()._.# noqawith reason — naive local time is intentional; cutoff and file mtimes are both naive, so adding a tz would change the comparison.# noqawith reason —NamedTemporaryFile(delete=False)path is returned for later use and unlinked by the caller; a context manager would change lifetime.Verification
uvx ruff@0.16.0 check .→ All checks passed!uvx ruff@0.16.0 format --check .→ cleanpython -m unittest discover -s tests→ 76 tests OKCame from
/retrofollow-up.