chore(deps): add ruff linter alongside existing tools#653
Merged
Conversation
Add ruff 0.15.2 as a dev dependency with [tool.ruff] configuration in pyproject.toml. New Makefile targets: `make ruff`, `make ruff-fix`, `make ruff-format`. Existing `make lint` and `make test` are unchanged. Rule set: E, F, W, I, B, UP, ASYNC, RUF006 Suppressed: E501 (black handles line length), E402, B006, B008, E741 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- I001: Sort imports per isort conventions (28 files) - UP024: IOError → OSError (alias since Python 3.3) - UP032: .format() → f-strings (3 instances) - UP034: Remove extraneous parentheses (2 instances) - UP020: io.open → open (alias since Python 3) - F841: Remove unused exception variable Black re-applied after ruff fixes to resolve formatting conflicts (black takes precedence per conflict resolution policy). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add `from e` to 58 raise statements inside except blocks to preserve the original exception chain in __cause__. Use `from None` for 3 cases where the original exception is intentionally suppressed. This preserves full tracebacks for debugging — previously, re-raised exceptions lost their original cause. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ions - UP031: Convert 27 remaining printf-style format strings to f-strings (test files and a few production lines missed in #651) - UP045: Optional[str] → str | None (PEP 604, 2 instances) - Remove unused `from typing import Optional` import Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- UP032: .format() → f-strings (residual from UP031 conversion) - I001: Re-sort imports after removing typing.Optional - F401: Remove unused `import io` (after UP020 converted io.open → open) Ruff now reports 0 violations. Black and all 361 tests pass. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
LaikaN57
commented
Feb 25, 2026
Comment on lines
-297
to
+294
| r"{0}(([\w]+)[|]([^{1}]+)){1}".format(left_wrapper, right_wrapper), string | ||
| rf"{left_wrapper}(([\w]+)[|]([^{right_wrapper}]+)){right_wrapper}", string |
Member
Author
There was a problem hiding this comment.
I think the intention here was to keep the regex readable, hence we used format instead of in-line f-strings.
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
make ruff,make ruff-fix,make ruff-formatViolation breakdown
raise from)import ioConflict resolution
TODO(ruff-primary))ruff formatNOT used — black remains the sole formattermake lint,make test) pass unchangedRule set enabled
E,F,W,I,B,UP,ASYNC,RUF006Test plan
make lintpasses (black unchanged)make test— 361 passed, 100% coveragemake ruff— 0 violations🤖 Generated with Claude Code