Skip to content
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

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

Merged
merged 3 commits into from
Sep 29, 2024

Conversation

why-arong
Copy link
Contributor

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
Copy link
Contributor Author

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 jopemachine changed the title Add pre-commit hooks for Rust formatting, linting, and Python code quality feat: Add pre-commit hooks for Rust formatting, linting, and Python code quality Sep 23, 2024
@jopemachine jopemachine added the ci label Sep 23, 2024
@jopemachine jopemachine changed the title feat: Add pre-commit hooks for Rust formatting, linting, and Python code quality feat: Add pre-commit hooks for code formatting, linting Sep 23, 2024
@jopemachine
Copy link
Member

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

@jopemachine jopemachine linked an issue Sep 23, 2024 that may be closed by this pull request
@jopemachine
Copy link
Member

jopemachine commented Sep 29, 2024

Ref:

Prerequisites:

  1. Install pre-commit using pip on dev environment
  2. Run pre-commit install

@jopemachine
Copy link
Member

Thanks!

@jopemachine jopemachine merged commit 4d91316 into lablup:main Sep 29, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants