-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
44 lines (40 loc) · 1.37 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
44 lines (40 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Pre-commit checks. Designed to run via `prek` (https://github.com/j178/prek)
# — a fast Rust-native drop-in for `pre-commit`. Same `.pre-commit-config.yaml`
# format, no Python venv to bootstrap.
#
# Setup:
# cargo install --git https://github.com/j178/prek
# prek install
#
# `prek install` writes `.git/hooks/pre-commit` and `pre-push` so these
# checks run automatically. Equivalent to the deleted ci.yml — checks
# happen before commit instead of after push.
default_install_hook_types: [pre-commit, pre-push]
repos:
# Rust formatting + lint — fast, run on every commit.
- repo: local
hooks:
- id: cargo-fmt
name: cargo fmt --check
entry: cargo fmt --all -- --check
language: system
types_or: [rust, toml]
pass_filenames: false
stages: [pre-commit]
- id: cargo-clippy
name: cargo clippy --workspace --all-targets -- -D warnings
entry: cargo clippy --workspace --all-targets -- -D warnings
language: system
types_or: [rust, toml]
pass_filenames: false
stages: [pre-commit]
# Slow Rust tests — run on push only, not every commit.
- repo: local
hooks:
- id: cargo-test
name: cargo test --workspace
entry: cargo test --workspace
language: system
types_or: [rust, toml]
pass_filenames: false
stages: [pre-push]