xushiyan commented on code in PR #103: URL: https://github.com/apache/hudi-rs/pull/103#discussion_r1714623436
########## .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 Review Comment: are these hooks fully compatible with what we are already formatting via github actions workflow and `make check-python/check-rust` commands? if not, we need to make them behave the same. And if possible, reuse the same `make` commands for reusability ########## .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 Review Comment: can you add a section in the `CONTRIBUTING.md` to describe and explain what kind of pre-commit changes will be make once a developer configures this pre-commit hook. ########## 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 Review Comment: this should be a devel dependency in pyproject.toml -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
