-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Description
Context
A recent PR review pointed out imports aren’t consistently sorted, and isort enforcement appears disabled/misconfigured (see PR #22 thread: #22 (comment)).
Current state
.pre-commit-config.yamlhas theisorthook commented out.- Ruff is configured but import sorting (
Irules) is not enabled yet (there’s a TODO inpyproject.toml). pyproject.tomlalready contains a[tool.isort]config (including import section headings like# Standard/# Third-Party/# First-Party).
Goal
Make import sorting deterministic and enforced (pre-commit + CI), without mixing a large formatting sweep into functional PRs.
Proposed plan
-
Decide enforcement tool
- Option A: enable
isortvia pre-commit (preferred if we want to preserve the import section headers as configured). - Option B: enable Ruff import sorting (
I) instead (fewer tools, but won’t preserve section-header comments the same way).
- Option A: enable
-
Enable enforcement
- Update
.pre-commit-config.yamlto enable the chosen hook(s). - If using Ruff
I, update Ruff config ([tool.ruff.lint] select) and verify settings.
- Update
-
One-time formatting sweep
- Run the sorter across the repo and commit the result as a dedicated PR.
Acceptance criteria
pre-commit run --all-fileseither fixes import order or fails when imports are out of order.- CI (or documented local command) enforces the same behavior.
- Import grouping stays consistent with the project’s conventions.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels