-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #85 drive-by: Add `pre-commit` checks --------- Co-authored-by: Alec Edgington <[email protected]>
- Loading branch information
Showing
13 changed files
with
1,363 additions
and
483 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
/target | ||
Cargo.lock | ||
|
||
# Python dirs | ||
.pytest_cache | ||
.venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 # Use the ref you want to point at | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-case-conflict | ||
- id: check-executables-have-shebangs | ||
- id: check-merge-conflict | ||
- id: check-toml | ||
- id: check-vcs-permalinks | ||
- id: check-yaml | ||
- id: detect-private-key | ||
- id: end-of-file-fixer | ||
exclude: | | ||
(?x)^( | ||
tests/data/.* | ||
)$ | ||
- id: trailing-whitespace | ||
exclude: | | ||
(?x)^( | ||
tests/data/.* | ||
)$ | ||
- id: fix-byte-order-marker | ||
- id: mixed-line-ending | ||
# Python-specific | ||
- id: check-ast | ||
- id: check-docstring-first | ||
- id: debug-statements | ||
|
||
- repo: local | ||
hooks: | ||
- id: ruff-format | ||
name: ruff format | ||
description: Format python code with `ruff`. | ||
entry: uv run ruff format | ||
language: system | ||
files: \.py$ | ||
pass_filenames: false | ||
- id: ruff-check | ||
name: ruff | ||
description: Check python code with `ruff`. | ||
entry: uv run ruff check --fix --exit-non-zero-on-fix | ||
language: system | ||
files: \.py$ | ||
pass_filenames: false | ||
- id: mypy-check | ||
name: mypy | ||
description: Check python code with `mypy`. | ||
entry: uv run mypy . | ||
language: system | ||
files: \.py$ | ||
pass_filenames: false | ||
- id: cargo-fmt | ||
name: cargo format | ||
description: Format rust code with `cargo fmt`. | ||
entry: cargo fmt --all -- --check | ||
language: system | ||
files: \.rs$ | ||
pass_filenames: false | ||
- id: cargo-check | ||
name: cargo check | ||
description: Check rust code with `cargo check`. | ||
entry: cargo check --all --all-features --workspace | ||
language: system | ||
files: \.rs$ | ||
pass_filenames: false | ||
- id: cargo-test | ||
name: cargo test | ||
description: Run tests with `cargo test`. | ||
entry: cargo test --all-features --workspace | ||
language: system | ||
files: \.rs$ | ||
pass_filenames: false | ||
- id: cargo-clippy | ||
name: cargo clippy | ||
description: Run clippy lints with `cargo clippy`. | ||
entry: cargo clippy --all-targets --all-features --workspace -- -D warnings | ||
language: system | ||
files: \.rs$ | ||
pass_filenames: false | ||
- id: cargo-doc | ||
name: cargo doc | ||
description: Generate documentation with `cargo doc`. | ||
entry: sh -c "RUSTDOCFLAGS=-Dwarnings cargo doc --no-deps --all-features --workspace" | ||
language: system | ||
files: \.rs$ | ||
pass_filenames: false | ||
- id: py-test | ||
name: pytest | ||
description: Run python tests | ||
entry: uv run pytest | ||
language: system | ||
files: \.py$ | ||
pass_filenames: false |
Oops, something went wrong.