|
1 | 1 | # See https://pre-commit.com for more information |
2 | 2 | # See https://pre-commit.com/hooks.html for more hooks |
3 | 3 | repos: |
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)$ |
| 4 | + # Basic hooks for Go, Rust, Python And JavaScript files only |
| 5 | + - repo: https://github.com/pre-commit/pre-commit-hooks |
| 6 | + rev: v4.2.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 | | -# 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$ |
| 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$ |
24 | 24 |
|
25 | | -- repo: local |
26 | | - hooks: |
27 | | - - id: golang-lint |
28 | | - name: go lint |
29 | | - entry: make go-lint |
30 | | - language: system |
31 | | - files: \.go$ |
32 | | - pass_filenames: false |
| 25 | + - repo: local |
| 26 | + hooks: |
| 27 | + - id: golang-lint |
| 28 | + name: go lint |
| 29 | + entry: make go-lint |
| 30 | + language: system |
| 31 | + files: \.go$ |
| 32 | + pass_filenames: false |
33 | 33 |
|
34 | | -# Markdown specific hooks |
35 | | -- repo: local |
36 | | - hooks: |
37 | | - - id: md-fmt |
38 | | - name: md fmt |
39 | | - entry: bash -c "make markdown-lint" |
40 | | - language: system |
41 | | - files: \.md$ |
42 | | - exclude: ^(\node_modules/|CLAUDE\.md) |
| 34 | + # Markdown specific hooks |
| 35 | + - repo: local |
| 36 | + hooks: |
| 37 | + - id: md-fmt |
| 38 | + name: md fmt |
| 39 | + entry: bash -c "make markdown-lint" |
| 40 | + language: system |
| 41 | + files: \.md$ |
| 42 | + exclude: ^(\node_modules/|CLAUDE\.md) |
43 | 43 |
|
44 | | -# Yaml specific hooks |
45 | | -- repo: local |
46 | | - hooks: |
47 | | - - id: yaml-and-yml-fmt |
48 | | - name: yaml/yml fmt |
49 | | - entry: bash -c "make markdown-lint" |
50 | | - language: system |
51 | | - files: \.(yaml|yml)$ |
52 | | - exclude: ^(\node_modules/) |
| 44 | + # Yaml specific hooks |
| 45 | + - repo: local |
| 46 | + hooks: |
| 47 | + - id: yaml-and-yml-fmt |
| 48 | + name: yaml/yml fmt |
| 49 | + entry: bash -c "make markdown-lint" |
| 50 | + language: system |
| 51 | + files: \.(yaml|yml)$ |
| 52 | + exclude: ^(\node_modules/) |
53 | 53 |
|
54 | | -# JavaScript and TypeScript specific hooks |
55 | | -- repo: local |
56 | | - hooks: |
57 | | - - id: js-ts-lint |
58 | | - name: js/ts lint |
59 | | - entry: bash -c 'cd website && npm install 2>/dev/null || true && npm run lint' |
60 | | - language: system |
61 | | - files: \.(js|ts|tsx)$ |
62 | | - exclude: ^(\node_modules/) |
63 | | - pass_filenames: false |
| 54 | + # JavaScript and TypeScript specific hooks |
| 55 | + - repo: local |
| 56 | + hooks: |
| 57 | + - id: js-ts-lint |
| 58 | + name: js/ts lint |
| 59 | + entry: bash -c 'cd website && npm install 2>/dev/null || true && npm run lint' |
| 60 | + language: system |
| 61 | + files: \.(js|ts|tsx)$ |
| 62 | + exclude: ^(\node_modules/) |
| 63 | + pass_filenames: false |
64 | 64 |
|
65 | | -# Rust specific hooks |
66 | | -- repo: local |
67 | | - hooks: |
68 | | - - id: cargo-fmt |
69 | | - name: cargo fmt |
70 | | - entry: bash -c 'cd candle-binding && rustup component add rustfmt 2>/dev/null || true && cargo fmt' |
71 | | - language: system |
72 | | - files: \.rs$ |
73 | | - pass_filenames: false |
74 | | - - id: cargo-check |
75 | | - name: cargo check |
76 | | - entry: bash -c 'cd candle-binding && cargo check' |
77 | | - language: system |
78 | | - files: \.rs$ |
79 | | - pass_filenames: false |
| 65 | + # Rust specific hooks |
| 66 | + - repo: local |
| 67 | + hooks: |
| 68 | + - id: cargo-fmt |
| 69 | + name: cargo fmt |
| 70 | + entry: bash -c 'cd candle-binding && rustup component add rustfmt 2>/dev/null || true && cargo fmt' |
| 71 | + language: system |
| 72 | + files: \.rs$ |
| 73 | + pass_filenames: false |
| 74 | + - id: cargo-check |
| 75 | + name: cargo check |
| 76 | + entry: bash -c 'cd candle-binding && cargo check' |
| 77 | + language: system |
| 78 | + files: \.rs$ |
| 79 | + pass_filenames: false |
80 | 80 |
|
81 | | -# Python specific hooks |
82 | | -- repo: https://github.com/psf/black |
83 | | - rev: 25.1.0 |
84 | | - hooks: |
85 | | - - id: black |
86 | | - language_version: python3 |
87 | | - files: \.py$ |
88 | | - exclude: ^(\.venv/|venv/|env/|__pycache__/|\.git/|site/) |
89 | | - |
90 | | -- repo: https://github.com/PyCQA/isort |
91 | | - rev: 6.0.1 |
92 | | - hooks: |
93 | | - - id: isort |
94 | | - args: ["--profile", "black"] |
95 | | - files: \.py$ |
96 | | - exclude: ^(\.venv/|venv/|env/|__pycache__/|\.git/|site/) |
| 81 | + # Python specific hooks |
| 82 | + # isort must run before black |
| 83 | + - repo: https://github.com/PyCQA/isort |
| 84 | + rev: 5.13.2 |
| 85 | + hooks: |
| 86 | + - id: isort |
| 87 | + args: ["--profile", "black", "--line-length", "88"] |
| 88 | + files: \.py$ |
| 89 | + exclude: ^(\.venv/|venv/|env/|__pycache__/|\.git/|site/) |
97 | 90 |
|
| 91 | + - repo: https://github.com/psf/black |
| 92 | + rev: 25.1.0 |
| 93 | + hooks: |
| 94 | + - id: black |
| 95 | + language_version: python3 |
| 96 | + files: \.py$ |
| 97 | + exclude: ^(\.venv/|venv/|env/|__pycache__/|\.git/|site/) |
98 | 98 | # Commented out flake8 - only reports issues, doesn't auto-fix |
99 | 99 | # - repo: https://github.com/PyCQA/flake8 |
100 | 100 | # rev: 7.3.0 |
|
0 commit comments