-
Notifications
You must be signed in to change notification settings - Fork 28
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
chore: configure pre-commit hooks for code formatting #103
base: main
Are you sure you want to change the base?
Conversation
4a2919a
to
9a95229
Compare
- Install pre-commit when using make setup. - Add pre-commit hooks for Python and Rust code formatting.
9a95229
to
075a26e
Compare
pip install pre-commit | ||
pre-commit install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be a devel dependency in pyproject.toml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it!
entry: cargo fmt --all -- --check | ||
language: system | ||
types: [rust] | ||
pass_filenames: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add a section in the CONTRIBUTING.md
to describe and explain what kind of pre-commit changes will be make once a developer configures this pre-commit hook.
- id: check-yaml | ||
- id: check-json | ||
- id: check-added-large-files | ||
- id: check-merge-conflict |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these hooks fully compatible with what we are already formatting via github actions workflow and make check-python/check-rust
commands? if not, we need to make them behave the same. And if possible, reuse the same make
commands for reusability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove the checks for YAML, JSON, and file validations compared to GitHub Actions? Alternatively, should we add corresponding configurations in GitHub Actions? And I attempted to utilize make check-python, but encountered an issue where mypy did not recognize the configuration from pyproject.toml, which block me reuse make commands。
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #103 +/- ##
=======================================
Coverage 87.42% 87.42%
=======================================
Files 14 14
Lines 700 700
=======================================
Hits 612 612
Misses 88 88 ☔ View full report in Codecov by Sentry. |
Description
This PR introduces pre-commit hooks to ensure consistent code formatting for both Python and Rust codebases. The changes include:
Related issues: #73
How are the changes test-covered