Skip to content

chore: sort imports so ruff check passes on main - #320

Merged
kkozik-amplify merged 1 commit into
mainfrom
chore/fix-import-order
Aug 25, 2026
Merged

chore: sort imports so ruff check passes on main#320
kkozik-amplify merged 1 commit into
mainfrom
chore/fix-import-order

Conversation

@kkozik-amplify

Copy link
Copy Markdown
Collaborator

Why

pre-commit run --all-files currently fails ruff check on main. Four files place from hcl2.version import __version__ ahead of the rest of the first-party import block, violating the I rule selected in pyproject.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.

bin/terraform_test | 3 +--
cli/hcl_to_json.py | 3 +--
cli/hq.py          | 3 +--
cli/json_to_hcl.py | 3 +--

Not a defect

don't commit to branch also fails during --all-files when main is the checked-out branch. That hook exists to block commits to main, so failing there is intended. Only ruff check was a real problem.

Test plan

  • pre-commit run --all-files: ruff check, ruff format and mypy all pass after the change
  • Full suite: 1470 tests, all passing

`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>
@kkozik-amplify
kkozik-amplify requested a review from a team as a code owner August 24, 2026 17:14
@kkozik-amplify
kkozik-amplify merged commit e8647d9 into main Aug 25, 2026
8 checks passed
@kkozik-amplify
kkozik-amplify deleted the chore/fix-import-order branch August 25, 2026 09:58
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