Enforce additional ruff rules and bump tooling versions#637
Merged
Conversation
- pyproject.toml: ruff>=0.15.0, ty>=0.0.33 - .pre-commit-config.yaml: ruff hook v0.13.0 -> v0.15.12 - types.py: migrate (str, Enum) -> StrEnum (UP042 from new ruff) - tools/altest: format-only changes from new ruff formatter
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Collaborator
Author
|
@copilot resolve the merge conflicts in this pull request |
Co-authored-by: haoranpb <27280733+haoranpb@users.noreply.github.com>
Co-authored-by: haoranpb <27280733+haoranpb@users.noreply.github.com>
Contributor
Resolved in b143081. The conflicts were:
All checks clean: ruff ✓ · 401 tests ✓ · pre-commit ✓ |
kmhansen
approved these changes
May 1, 2026
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.
Started from removing two unused module-level globals that no linter caught. Turns out we were under-using ruff and ty (old versions, minimal rules).
One rule per commit, each justified.
Added
TRY400—logger.error()in except →logger.exception()(17 fixes)LOG,G— guardrails for logger misuse, no current violationsPT— pytest patterns, 15 fixes (composite asserts, broadpytest.raises, fixture style)ANN— type annotations insrc/andevaluator/, 32 fixesT20— caught 2 stale debug prints + 1 missing logger callFURB,ISC,ICN,FA,PYI,SLOT,ASYNC— zero-cost guardrail bundleTID(full),TRY(full minus 3) — promoted from sub-rules, caught 11 redundant{e}inlogger.exception()class X(str, Enum)→StrEnumSkipped (with reasons in commit history)
S(too noisy),EM(low value, lots of churn),ERA(too many false positives),PERF(controversial)Open follow-ups
ANN401still ignored —**kwargs: Anyinresults/base.pyfor kwarg forwarding. Triedobjectand narrow unions, both fail; aTypedDictrefactor works but verbose. Wants more thinking.uvx-spawned env can't importbcbench, hides errors involving our own types. Fix included in this PR (switched touv run+language: system); 12 pre-existing type errors intests/test_evaluation_summary.pynow visible, to be fixed separately.Validation
uv run ruff check .clean ·uv run pytest tests/400 passed ·uv run pre-commit run --all-filesclean