Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added pre-commit hook that sort imports and formats #3455

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

chiamp
Copy link
Collaborator

@chiamp chiamp commented Oct 31, 2023

Added a rule to the ruff pre-commit hook that sort imports.
Added examples/ as an exclusion of fixable files for ruff, since sorting imports caused a seg fault.
See a full list of ruff rules here.

Added formatting rules to ruff.
Modified .pre-commit-config.yaml so that both the linter and formatter auto-fix the code when you run pre-commit run --all-files. To manually run the ruff linter and formatter, run ruff check . --fix and ruff format ., respectively.

@copybara-service copybara-service bot merged commit 1f71cdc into google:main Nov 2, 2023
19 checks passed
@chiamp chiamp deleted the format branch November 2, 2023 18:13
@chiamp chiamp mentioned this pull request Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant