Closed why-arong closed 1 month ago
Note: After this PR is merged, the contribution guide should be updated to include the new pre-commit hooks. Contributors will need to install and configure the pre-commit hooks locally to ensure proper formatting and linting before making any commits.
Does code formatting and linting checks also apply to the crate in the binding/python directory, in addition to the root directory?
Ref:
Prerequisites:
pre-commit
using pip on dev environmentpre-commit install
Thanks!
This PR introduces pre-commit hooks to ensure consistent code quality and formatting across the project. The following hooks were added:
Rust Hooks:
cargo fmt
: Automatically formats Rust code according to the standard style.cargo clippy
: Lints Rust code to detect potential issues and improve code quality.General Code Quality Hooks:
trailing-whitespace
: Removes unnecessary trailing whitespace from files.end-of-file-fixer
: Ensures that files end with a newline.check-yaml
: Validates YAML file syntax.check-added-large-files
: Prevents large files from being accidentally committed to the repository.Python Hooks:
ruff
: Lints Python code and automatically fixes style issues.