|
2 | 2 | # See https://pre-commit.com/hooks.html for more hooks
|
3 | 3 | repos:
|
4 | 4 | # Basic hooks for Go, Rust, Python And JavaScript files only
|
5 |
| -- repo: https://github.com/pre-commit/pre-commit-hooks |
6 |
| - rev: v6.0.0 |
7 |
| - hooks: |
8 |
| - - id: trailing-whitespace |
9 |
| - files: \.(go|rs|py|js)$ |
10 |
| - - id: end-of-file-fixer |
11 |
| - files: \.(go|rs|py|js)$ |
12 |
| - - id: check-added-large-files |
13 |
| - args: ['--maxkb=500'] |
14 |
| - files: \.(go|rs|py|js)$ |
| 5 | +- repo: https://github.com/pre-commit/pre-commit-hooks |
| 6 | + rev: v6.0.0 |
| 7 | + hooks: |
| 8 | + - id: trailing-whitespace |
| 9 | + files: \.(go|rs|py|js)$ |
| 10 | + - id: end-of-file-fixer |
| 11 | + files: \.(go|rs|py|js)$ |
| 12 | + - id: check-added-large-files |
| 13 | + args: ['--maxkb=500'] |
| 14 | + files: \.(go|rs|py|js)$ |
15 | 15 |
|
16 | 16 | # Go specific hooks
|
17 |
| -- repo: local |
18 |
| - hooks: |
19 |
| - - id: go-fmt |
20 |
| - name: go fmt |
21 |
| - entry: gofmt -w |
22 |
| - language: system |
23 |
| - files: \.go$ |
| 17 | +- repo: local |
| 18 | + hooks: |
| 19 | + - id: go-fmt |
| 20 | + name: go fmt |
| 21 | + entry: gofmt -w |
| 22 | + language: system |
| 23 | + files: \.go$ |
24 | 24 |
|
25 | 25 | # Markdown specific hooks
|
26 |
| -- repo: local |
27 |
| - hooks: |
28 |
| - - id: md-fmt |
29 |
| - name: md fmt |
30 |
| - entry: bash -c "make markdown-lint" |
31 |
| - language: system |
32 |
| - files: \.md$ |
33 |
| - exclude: ^(\node_modules/) |
| 26 | +- repo: local |
| 27 | + hooks: |
| 28 | + - id: md-fmt |
| 29 | + name: md fmt |
| 30 | + entry: bash -c "make markdown-lint" |
| 31 | + language: system |
| 32 | + files: \.md$ |
| 33 | + exclude: ^(\node_modules/) |
| 34 | + |
| 35 | +# Yaml specific hooks |
| 36 | +- repo: local |
| 37 | + hooks: |
| 38 | + - id: yaml-and-yml-fmt |
| 39 | + name: yaml/yml fmt |
| 40 | + entry: bash -c "make markdown-lint" |
| 41 | + language: system |
| 42 | + files: \.(yaml|yml)$ |
| 43 | + exclude: ^(\node_modules/) |
34 | 44 |
|
35 | 45 | # JavaScript specific hooks
|
36 |
| -- repo: local |
37 |
| - hooks: |
38 |
| - - id: js-lint |
39 |
| - name: js lint |
40 |
| - entry: bash -c 'cd website && npm install 2>/dev/null || true && npm run lint' |
41 |
| - language: system |
42 |
| - files: \.js$ |
43 |
| - exclude: ^(\node_modules/) |
44 |
| - pass_filenames: false |
| 46 | +- repo: local |
| 47 | + hooks: |
| 48 | + - id: js-lint |
| 49 | + name: js lint |
| 50 | + entry: bash -c 'cd website && npm install 2>/dev/null || true && npm run lint' |
| 51 | + language: system |
| 52 | + files: \.js$ |
| 53 | + exclude: ^(\node_modules/) |
| 54 | + pass_filenames: false |
45 | 55 |
|
46 |
| -# Rust specific hooks |
47 |
| -- repo: local |
48 |
| - hooks: |
49 |
| - - id: cargo-fmt |
50 |
| - name: cargo fmt |
51 |
| - entry: bash -c 'cd candle-binding && rustup component add rustfmt 2>/dev/null || true && cargo fmt' |
52 |
| - language: system |
53 |
| - files: \.rs$ |
54 |
| - pass_filenames: false |
55 |
| - - id: cargo-check |
56 |
| - name: cargo check |
57 |
| - entry: bash -c 'cd candle-binding && cargo check' |
58 |
| - language: system |
59 |
| - files: \.rs$ |
60 |
| - pass_filenames: false |
| 56 | +# Rust specific hooks |
| 57 | +- repo: local |
| 58 | + hooks: |
| 59 | + - id: cargo-fmt |
| 60 | + name: cargo fmt |
| 61 | + entry: bash -c 'cd candle-binding && rustup component add rustfmt 2>/dev/null || true && cargo fmt' |
| 62 | + language: system |
| 63 | + files: \.rs$ |
| 64 | + pass_filenames: false |
| 65 | + - id: cargo-check |
| 66 | + name: cargo check |
| 67 | + entry: bash -c 'cd candle-binding && cargo check' |
| 68 | + language: system |
| 69 | + files: \.rs$ |
| 70 | + pass_filenames: false |
61 | 71 |
|
62 | 72 | # Python specific hooks
|
63 |
| -- repo: https://github.com/psf/black |
64 |
| - rev: 25.1.0 |
65 |
| - hooks: |
66 |
| - - id: black |
67 |
| - language_version: python3 |
68 |
| - files: \.py$ |
69 |
| - exclude: ^(\.venv/|venv/|env/|__pycache__/|\.git/|site/) |
| 73 | +- repo: https://github.com/psf/black |
| 74 | + rev: 25.1.0 |
| 75 | + hooks: |
| 76 | + - id: black |
| 77 | + language_version: python3 |
| 78 | + files: \.py$ |
| 79 | + exclude: ^(\.venv/|venv/|env/|__pycache__/|\.git/|site/) |
70 | 80 |
|
71 |
| -- repo: https://github.com/PyCQA/isort |
72 |
| - rev: 6.0.1 |
73 |
| - hooks: |
74 |
| - - id: isort |
75 |
| - args: ["--profile", "black"] |
76 |
| - files: \.py$ |
77 |
| - exclude: ^(\.venv/|venv/|env/|__pycache__/|\.git/|site/) |
| 81 | +- repo: https://github.com/PyCQA/isort |
| 82 | + rev: 6.0.1 |
| 83 | + hooks: |
| 84 | + - id: isort |
| 85 | + args: ["--profile", "black"] |
| 86 | + files: \.py$ |
| 87 | + exclude: ^(\.venv/|venv/|env/|__pycache__/|\.git/|site/) |
78 | 88 |
|
79 | 89 | # Commented out flake8 - only reports issues, doesn't auto-fix
|
80 | 90 | # - repo: https://github.com/PyCQA/flake8
|
|
0 commit comments