diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..8df51abb --- /dev/null +++ b/.pre-commit-config.yaml @@ -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 diff --git a/python/Makefile b/python/Makefile index 4badaca8..3be8f905 100644 --- a/python/Makefile +++ b/python/Makefile @@ -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