-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Configure pre-commit, update the justfile (#890)
Setups `pre-commit` instead of the ad-hoc `.github/pre-commit` file, and cleans up the `just` recipes. The main benefit of this is to avoid running both codebase tests on each commit, since `pre-commit` filters the required checks based on the modified files. Updates `DEVELOPMENT.md` with the new commands. It should be a bit more straightforward now. drive-by: Fixes for the `trailing-whitespace` and `end-of-file-fixer` hooks.
- Loading branch information
Showing
14 changed files
with
341 additions
and
121 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ name: Unsoundness checks | |
on: | ||
push: | ||
branches: | ||
- main | ||
- main | ||
workflow_dispatch: {} | ||
|
||
concurrency: | ||
|
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
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: ^specification/schema/ | ||
- id: trailing-whitespace | ||
- id: fix-byte-order-marker | ||
- id: mixed-line-ending | ||
# Python-specific | ||
- id: check-ast | ||
- id: check-docstring-first | ||
- id: debug-statements | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.3.0 | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] | ||
- id: ruff-format | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.9.0 | ||
hooks: | ||
- id: mypy | ||
additional_dependencies: [pydantic] | ||
|
||
- repo: local | ||
hooks: | ||
- 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-features --workspace -- -D warnings | ||
language: system | ||
files: \.rs$ | ||
pass_filenames: false |
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
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 |
---|---|---|
|
@@ -5,4 +5,4 @@ inputs: | |
url: github:nix-community/fenix | ||
inputs: | ||
nixpkgs: | ||
follows: nixpkgs | ||
follows: nixpkgs |
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
Oops, something went wrong.