Replace flake8/isort with ruff, add uv supply-chain safety#312
Replace flake8/isort with ruff, add uv supply-chain safety#312rtibblesbot wants to merge 3 commits intolearningequality:release-v0.9.xfrom
Conversation
b9084d1 to
51f3ea1
Compare
pyproject.toml
Outdated
| max-line-length = 160 | ||
| max-complexity = 10 | ||
| [tool.ruff] | ||
| line-length = 160 |
There was a problem hiding this comment.
Lets drop the line length down to 100. While it was 160 before, I think most of the code adhered to 100. So changing this to 100 should eliminate a lot of the code formatting changes here.
There was a problem hiding this comment.
Done — dropped to 100 and added E501 to the lint ignore list (109 lines in the codebase exceed 100 chars but can't be auto-wrapped by ruff, e.g. long strings and comments). The Python diff shrank from ~3420 to ~2850 changed lines.
There was a problem hiding this comment.
Done — dropped to 100 and added E501 to the lint ignore list (109 lines in the codebase exceed 100 chars but can't be auto-wrapped by ruff, e.g. long strings and comments). The Python diff shrank from ~3420 to ~2850 changed lines.
There was a problem hiding this comment.
Done — dropped to 100 and added E501 to the lint ignore list (109 lines in the codebase exceed 100 chars but can't be auto-wrapped by ruff, e.g. long strings and comments). The Python diff shrank from ~3420 to ~2850 changed lines.
Replace flake8, reorder-python-imports, and debug-statements pre-commit hooks with ruff for unified linting, formatting, and import sorting. Migrate configuration from [tool.flake8] and [tool.isort] to [tool.ruff] in pyproject.toml (line-length 100, E501 ignored). Apply all ruff auto-fixes: import reordering, unused import removal, and formatting normalization across the codebase. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pin uv dependency resolution to a 7-day lookback window to avoid pulling in newly published packages that may be compromised. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Throttle dependabot PRs to reduce noise from frequent minor version bumps across all package ecosystems. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
68b6729 to
bbb618b
Compare
Summary
Replace flake8/reorder-python-imports with ruff for linting and formatting, add uv
exclude-newerfor supply chain safety, and add dependabot cooldown. Follows the same approach as learningequality/kolibri#14457 for ecosystem consistency.The large diff is expected —
ruff formattouched ~100 files since no formatter was previously configured, and ruff's isort reordered imports differently than the oldreorder-python-importstool. No runtime behavior changes; config files only.TODO
Reviewer guidance
pyproject.toml— verify ruff rule selection (E/W/F/I/T10/T20/C90) maps correctly from the old flake8 config.pre-commit-config.yaml— verify old hooks (flake8, debug-statements, reorder-python-imports) are fully removed and ruff + uv-lock hooks are addedruff formatandruff check --fix— no manual editsIssues addressed
Closes #311
AI usage
Implementation and PR by Claude Code. Verified via pre-commit hooks passing on all files and full test suite passing.
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?