lablup / raftify

Experimental High level Raft framework
https://docs.rs/raftify/latest/raftify
Apache License 2.0
36 stars 14 forks source link

feat: Add pre-commit hooks for code formatting, linting #129

Closed why-arong closed 1 month ago

why-arong commented 1 month ago

This PR introduces pre-commit hooks to ensure consistent code quality and formatting across the project. The following hooks were added:

  1. 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.
  2. 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.
  3. Python Hooks:

    • ruff: Lints Python code and automatically fixes style issues.
why-arong commented 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.

jopemachine commented 1 month ago

Does code formatting and linting checks also apply to the crate in the binding/python directory, in addition to the root directory?

jopemachine commented 1 month ago

Ref:

Prerequisites:

  1. Install pre-commit using pip on dev environment
  2. Run pre-commit install
jopemachine commented 1 month ago

Thanks!