Context A recent PR review pointed out imports aren’t consistently sorted, and isort enforcement appears disabled/misconfigured (see PR #22 thread: https://github.com/contextforge-org/contextforge-cli/pull/22#discussion_r2812997057). Current state - `.pre-commit-config.yaml` has the `isort` hook commented out. - Ruff is configured but import sorting (`I` rules) is not enabled yet (there’s a TODO in `pyproject.toml`). - `pyproject.toml` already 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 1) Decide enforcement tool - Option A: enable `isort` via 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). 2) Enable enforcement - Update `.pre-commit-config.yaml` to enable the chosen hook(s). - If using Ruff `I`, update Ruff config (`[tool.ruff.lint] select`) and verify settings. 3) One-time formatting sweep - Run the sorter across the repo and commit the result as a dedicated PR. Acceptance criteria - `pre-commit run --all-files` either 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.
Activity
[-]Re-enable isort import sorting (pre-commit + sweep)[/-][+][Chore] Re-enable isort import sorting (pre-commit + sweep)[/+]