Repository navigation
Run ruff check in CI with the first group of rule families - #765
Merged
Merged
Conversation
anth-volk
added this pull request to stack #755
October 12, 2026 20:43
2 tasks done
anth-volk
force-pushed
the
ruff-safe-autofixes
branch
from
October 13, 2026 16:56
191837d to
b2b04e9
Compare
anth-volk
force-pushed
the
ruff-safe-autofixes
branch
3 times, most recently
from
October 14, 2026 14:47
019fe7e to
7fa12ee
Compare
anth-volk
force-pushed
the
ruff-safe-autofixes
branch
from
October 14, 2026 17:29
7fa12ee to
c4eb50a
Compare
anth-volk
force-pushed
the
ruff-safe-autofixes
branch
3 times, most recently
from
October 14, 2026 20:04
c3fbc7e to
5d74e00
Compare
anth-volk
force-pushed
the
ruff-safe-autofixes
branch
2 times, most recently
from
October 14, 2026 21:43
00d5abd to
e940d49
Compare
anth-volk
force-pushed
the
ruff-safe-autofixes
branch
2 times, most recently
from
October 14, 2026 22:04
6f81c14 to
31adebf
Compare
Select FLY, FURB, I, PIE, PYI, RET, RSE, UP and W, and fix every finding: ruff's safe fixes (import sorting, pyupgrade), then by hand: - policyengine-fastapi re-exports JWTDecoder through __all__ and drops two unused imports (the 9 F401s noted in Phase 0). - Two tests build their JSON receipts with json.dumps, not % formatting. - smoke_app uses min() rather than sorted()[0] (ruff 0.16 FURB192). scripts/** is linted as Python 3.11, the shared rules tool's minimum, so import sorting matches policyengine-api byte for byte. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lint job now runs ruff check . on the whole repository, and sim.quality.ruff-lint moves from advisory to enforced with the codes selected in ruff.toml. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#767 landed on main after this stack branched, and its new test imports are unsorted under the I rule this PR enables. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#787 landed on main after this stack branched. It renamed the macro result fixture module to fixtures.macro_output and added fixtures.fake_object_store, and those imports in the output builder, Stage 12 artifact and Stage 12 runtime tests are unsorted under the I rule this PR enables. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#791 landed on main after this stack branched. I, which this PR enables, flags the import block of its new Stage 12 failure-cause tests; ruff's safe fix sorts it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
force-pushed
the
ruff-safe-autofixes
branch
from
October 15, 2026 14:06
31adebf to
87d86ec
Compare
anth-volk
marked this pull request as ready for review
October 15, 2026 15:08
anth-volk
added a commit
that referenced
this pull request
Oct 15, 2026
Brings in #765 (ruff check in CI with the first group of rule families), #809 (policyengine 6.4.1) and #791 (redacted Stage 12 failure cause). Conflicts: - auth.py: kept this branch's Callable and Literal imports and sorted the stdlib import block the way main's newly enabled I rule expects. - docs/generated/rules.md: regenerated with python -m scripts.rules render from the auto-merged registry, which holds main's enforced sim.quality.ruff-lint and this branch's sim.deploy.permission-enforcement-wired (34 of 48 rules blocking). ruff check . passes under main's ruff.toml with ruff 0.15.22, so this branch's own code needed no further changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 tasks done
anth-volk
added a commit
that referenced
this pull request
Oct 15, 2026
Resolved import-only conflicts in v2_app and two Stage 12 test modules, then applied the newly enforced ruff rules (import sorting, pyupgrade) to the files this branch adds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 tasks done
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.
Fixes #764
Same-Repository Draft PR Check
PolicyEngine/policyengine-sim-api, not a personal fork.Summary
Phase 1 step 1.8, group 1 of about 8: safe auto-fixes. Stacked on #763.
uv run ruff check .now runs in thelintjob on the whole repository, with ruff pinned to 0.15.22.ruff.tomladds FLY, FURB, I, PIE, PYI, RET, RSE, UP and W. Every finding is fixed (about 270, mostly import sorting and pyupgrade).policyengine-fastapire-exportsJWTDecoderthrough__all__and drops two unused imports (the 9 F401s noted in Phase 0).json.dumpsinstead of%formatting.smoke_appusesmin()instead ofsorted()[0], so ruff 0.16 (FURB192) is clean too.async with ... as resourcewas removed.scripts/**is linted as Python 3.11. There's no rootpyproject.toml, so it was treated as 3.9. 3.11 is the shared rules tool's minimum, and import sorting now matches policyengine-api byte for byte.sim.quality.ruff-lintmoves from advisory to enforced.main: Count households once: sum the weight column unweighted #767 added a test with unsorted imports. The commit "Sort the imports in the budget output test from Count households once: sum the weight column unweighted #767" fixes it.Testing
All seven projects' test suites pass:
ruff check .passes with 0.15.22 and 0.16.8, and the format check is unchanged.uv.lockfiles are unchanged.🤖 Generated with Claude Code