chore: configure pre-commit hooks for code formatting#103
chore: configure pre-commit hooks for code formatting#103muyihao wants to merge 2 commits intoapache:mainfrom
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.
this should be a devel dependency in pyproject.toml
| entry: cargo fmt --all -- --check | ||
| language: system | ||
| types: [rust] | ||
| pass_filenames: false |
There was a problem hiding this comment.
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.
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.
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