chore: bump ruff to 0.16.0 and fix new default-rule violations - #4213
Open
d-v-b wants to merge 2 commits into
Open
chore: bump ruff to 0.16.0 and fix new default-rule violations#4213d-v-b wants to merge 2 commits into
d-v-b wants to merge 2 commits into
Conversation
Ruff 0.16.0 enables a much larger default rule set (flake8-bugbear, blind-except, bandit subset, pylint subset, etc.) and formats Python code blocks inside Markdown files. This bumps the pin in pyproject.toml and pre-commit, applies the automatic fixes (RUF036 None-at-end-of-union, RUF100 unused noqa, PLR1716 chained comparison), and resolves the rest by hand: - StorePath.__eq__ narrows a blind 'except Exception: pass' to 'except AttributeError: return False' (BLE001/S110) - reset_resources_after_fork drops 'loop' and 'iothread' from the global statement; they are mutated in place, not rebound (PLW0602) - subprocess.run calls in tests pass check=False explicitly since they assert on returncode themselves (PLW1510) - intentional patterns (returning the caught exception in sync._runner, self-equality assertion in the store test suite) get targeted noqa comments (BLE001/PLR0124) Assisted-by: ClaudeCode:claude-fable-5
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4213 +/- ##
=======================================
Coverage 93.91% 93.92%
=======================================
Files 91 91
Lines 12723 12722 -1
=======================================
Hits 11949 11949
+ Misses 774 773 -1
🚀 New features to boost your workflow:
|
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.
Summary
Ruff 0.16 is stricter. this PR makes our codebase pass the new checks. closes #4212
A few code changes:
Assisted-by: ClaudeCode:claude-fable-5
For reviewers
Have a look at the changes and new rules and judge if they are acceptable
Author attestation
TODO
docs/user-guide/*.mdchanges/