Skip to content

Enable ruff isort import rules#677

Merged
rtibbles merged 3 commits into
learningequality:mainfrom
rtibbles:enable-ruff-isort
Jun 12, 2026
Merged

Enable ruff isort import rules#677
rtibbles merged 3 commits into
learningequality:mainfrom
rtibbles:enable-ruff-isort

Conversation

@rtibbles

Copy link
Copy Markdown
Member

Summary

Import-ordering enforcement was silently lost when ricecooker migrated from reorder_python_imports to ruff — the I rule category was never added to ruff's select, so nothing reordered or split imports. This adds I and configures isort to reproduce the old one-per-line style (force-single-line, order-by-type = false, i.e. case-insensitive rather than CapWords-first). ricecooker had no isort config at all, so one was added.

Three commits: the config change, a mechanical one-time reformat (37 files, ruff check --fix), and a new .git-blame-ignore-revs (didn't previously exist) with the reformat.

References

None — no tracking issue. Part of a cross-repo pass restoring import-ordering enforcement after the uv migrations.

Reviewer guidance

The reformat commit is purely mechanical — review the config commit for intent. The reformat is excluded from git blame via .git-blame-ignore-revs. Verify with ruff check --select I . (clean on the branch).

Each reformat diff was scanned for semantic import-order changes; none were found in this repo.

AI usage

Used Claude Code to investigate why import style was no longer enforced after the uv migration, derive the ruff isort config that reproduces the old reorder_python_imports behaviour, and apply it. The reformat diff was reviewed for load-bearing import-order changes before committing.

rtibbles and others added 3 commits June 11, 2026 15:23
Add the "I" rule category to ruff's lint selection so import ordering is
enforced again after the uv migration dropped reorder-python-imports. Configure
isort to match the prior reorder-python-imports behaviour: force-single-line
(one import per line) and order-by-type=false (case-insensitive alphabetical,
not CapWords-first).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
One-time mechanical reformat from enabling the "I" rule category. No logic
changes — only import ordering, force-single-line splitting, and normalised
blank lines after import blocks.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rtibbles rtibbles marked this pull request as ready for review June 11, 2026 22:53

@bjester bjester left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rtibbles rtibbles merged commit c99c28a into learningequality:main Jun 12, 2026
36 of 39 checks passed
@rtibbles rtibbles deleted the enable-ruff-isort branch June 12, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants