chore: sort imports so ruff check passes on main - #320
Merged
Conversation
`pre-commit run --all-files` fails ruff check on main: four files place `from hcl2.version import __version__` ahead of the rest of the first-party block, violating the `I` rule the repo selects. Import order only -- no behaviour change, no reordering across modules with side effects. Applied by `ruff check --fix`. Pre-existing, unrelated to any open PR; it just makes a clean `pre-commit run --all-files` impossible, which hides real failures. Note: `don't commit to branch` also fails when the suite is run while main is checked out. That hook is a guard against committing to main and failing there is its intended behaviour, not a defect. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
rddimon
approved these changes
Aug 25, 2026
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.
Why
pre-commit run --all-filescurrently failsruff checkonmain. Four files placefrom hcl2.version import __version__ahead of the rest of the first-party import block, violating theIrule selected inpyproject.toml.A repo whose lint sweep is red by default makes it hard to tell a new failure from the background noise — this came up while landing the current batch of fix PRs.
What
Import order only, applied by
ruff check --fix. No behaviour change.Not a defect
don't commit to branchalso fails during--all-fileswhen main is the checked-out branch. That hook exists to block commits to main, so failing there is intended. Onlyruff checkwas a real problem.Test plan
pre-commit run --all-files: ruff check, ruff format and mypy all pass after the change