Fix ruff import sorting + activate pre-commit hook#2
Merged
Conversation
Sort imports in three files to satisfy ruff's I001 (force-sort-within-sections), which was failing CI, and apply ruff format to a test file whose multi-line signatures fit within the 100-char limit. Also remove --exit-zero from the ruff pre-commit hook so unfixable lint errors block the commit locally, mirroring CI's strict `ruff check .`. Root cause: the pre-commit config existed but the git hook was never installed (`pre-commit install`), so lint-dirty commits reached CI unchecked. The format issue was latent because CI stops at the failing `ruff check` step before reaching `ruff format --check`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
I001(force-sort-within-sections) — the CI failure in run 29222908650.ruff formattotests/api/test_settings_router_secrets.py(two multi-line signatures collapse within the 100-char limit).--exit-zerofrom the ruff pre-commit hook so unfixable lint errors block commits locally, mirroring CI's strictruff check ..Root cause
.pre-commit-config.yamlexisted and already included ruff, but the git hook was never installed (pre-commit install), so lint-dirty commits reached CI unchecked. The formatting issue was latent: CI stops at the failingruff checkstep before it reaches the separateruff format --checkstep.Note for contributors
pre-commit installis per-clone and not tracked by git — each contributor must run it once after cloning for the hook to be active. Worth adding to the README/CONTRIBUTING as a follow-up.🤖 Generated with Claude Code