-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
57 lines (52 loc) · 1.65 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
57 lines (52 loc) · 1.65 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
45
46
47
48
49
50
51
52
53
54
55
56
57
# Pre-commit hooks for breakpoint
# Run manually: pre-commit run --all-files
# Install hooks: pre-commit install
# Skip specific hooks: SKIP=shellcheck git commit
# Auto-update hooks: pre-commit autoupdate
repos:
# General file hygiene
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
args: [--unsafe]
- id: check-added-large-files
args: [--maxkb=1000]
- id: check-json
- id: pretty-format-json
args: [--autofix, --no-sort-keys]
- id: check-merge-conflict
- id: check-case-conflict
- id: mixed-line-ending
args: [--fix=lf]
# GitHub Actions workflow linting
- repo: https://github.com/rhysd/actionlint
rev: v1.7.10
hooks:
- id: actionlint
# Shell script linting
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.10.0.1
hooks:
- id: shellcheck
types: [shell]
args: [-x]
# Rust formatting (local, runs on every commit — fast)
# Clippy runs on pre-push only (slower, but catches lint before CI)
- repo: local
hooks:
- id: rust-fmt
name: Rust format
entry: bash -c 'source "$HOME/.cargo/env" 2>/dev/null || true; cargo fmt --all -- --check'
language: system
files: '\.rs$'
pass_filenames: false
- id: rust-clippy
name: Rust clippy
entry: bash -c 'source "$HOME/.cargo/env" 2>/dev/null || true; cargo clippy --workspace --all-targets -- -D warnings'
language: system
files: '\.rs$'
pass_filenames: false
stages: [pre-push]