-
Notifications
You must be signed in to change notification settings - Fork 38
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
chore: configure pre-commit hooks for code formatting #103
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can you add a section in the |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
Comment on lines
+33
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be a devel dependency in pyproject.toml There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it! |
||
|
||
.PHONY: build | ||
build: setup ## Build Python binding of delta-rs | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 samemake
commands for reusabilityThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove the checks for YAML, JSON, and file validations compared to GitHub Actions? Alternatively, should we add corresponding configurations in GitHub Actions? And I attempted to utilize make check-python, but encountered an issue where mypy did not recognize the configuration from pyproject.toml, which block me reuse make commands。