Skip to content

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Mar 31, 2025

Use https://pre-commit.com to run linting and formatting utilities like ruff and yapf on developer machines as part of the git commit process. Run the same process on GitHub Actions to catch any issues from developers who do not have pre-commit installed locally. This automates linting and formatting before commits are pushed to the repository to eliminate GitHub Actions runs for small issues.

% pre-commit install

pre-commit installed at .git/hooks/pre-commit

% pre-commit autoupdate

[https://github.com/astral-sh/ruff-pre-commit] already up to date!
[https://github.com/google/yapf] already up to date!

% pre-commit run --all-files --verbose

ruff.....................................................................Passed
- hook id: ruff
- duration: 0.06s

All checks passed!

yapf.....................................................................Passed
- hook id: yapf
- duration: 4.22s

Yapf is a bit slow for a pre-commit hook but should still save turnaround time.

@cclauss cclauss closed this Sep 30, 2025
@cclauss cclauss deleted the pre-commit branch September 30, 2025 10:03
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.

1 participant