Skip to content

Commit

Permalink
chore: configure pre-commit hooks for code formatting
Browse files Browse the repository at this point in the history
- Add pre-commit hooks for Python and Rust code formatting.
- Format existing code using the new pre-commit hooks.
  • Loading branch information
yanghao14 committed Jul 28, 2024
1 parent 3e71bb0 commit 9a95229
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-added-large-files
- id: check-merge-conflict

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.2.0
hooks:
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.0
hooks:
- id: mypy

- repo: local
hooks:
- id: cargo-fmt
name: cargo fmt
entry: cargo fmt --all -- --check
language: system
types: [rust]
pass_filenames: false
2 changes: 2 additions & 0 deletions python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ setup-venv: ## Setup the virtualenv
setup: ## Setup the requirements
$(info --- Setup dependencies ---)
pip install "$(MATURIN_VERSION)"
pip install pre-commit
pre-commit install

.PHONY: build
build: setup ## Build Python binding of delta-rs
Expand Down

0 comments on commit 9a95229

Please sign in to comment.