-
Notifications
You must be signed in to change notification settings - Fork 558
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
107 lines (98 loc) · 2.85 KB
/
.pre-commit-config.yaml
File metadata and controls
107 lines (98 loc) · 2.85 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
# Basic hooks for Go, Rust, Python And JavaScript files only
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
hooks:
- id: trailing-whitespace
files: \.(go|rs|py|js)$
- id: end-of-file-fixer
files: \.(go|rs|py|js)$
exclude: ^website/build/
- id: check-added-large-files
args: ["--maxkb=500"]
files: \.(go|rs|py|js)$
# Go specific hooks
- repo: local
hooks:
- id: go-fmt
name: go fmt
entry: gofmt -w
language: system
files: \.go$
- repo: local
hooks:
- id: shellcheck
name: shellcheck
entry: make shellcheck
language: system
files: \.sh$
- repo: local
hooks:
- id: golang-lint
name: go lint
entry: make go-lint
language: system
files: \.go$
pass_filenames: false
# Markdown specific hooks
- repo: local
hooks:
- id: md-fmt
name: md fmt
entry: bash -c "make markdown-lint"
language: system
files: \.md$
exclude: ^(\node_modules/|CLAUDE\.md)
# Yaml specific hooks
- repo: local
hooks:
- id: yaml-and-yml-fmt
name: yaml/yml fmt
entry: bash -c "make yaml-lint"
language: system
files: \.(yaml|yml)$
exclude: ^(\node_modules/)
# JavaScript and TypeScript specific hooks
- repo: local
hooks:
- id: js-ts-lint
name: js/ts lint
entry: bash -c 'cd website && npm install 2>/dev/null || true && npm run lint'
language: system
files: \.(js|ts|tsx)$
exclude: ^(\node_modules/)
pass_filenames: false
# Rust specific hooks
- repo: local
hooks:
- id: cargo-fmt
name: cargo fmt
entry: bash -c 'cd candle-binding && rustup component add rustfmt 2>/dev/null || true && cargo fmt'
language: system
files: \.rs$
pass_filenames: false
- id: cargo-check
name: cargo check
entry: bash -c 'cd candle-binding && cargo check --no-default-features'
language: system
files: \.rs$
pass_filenames: false
# Python specific hooks
# Using only Black for Python formatting (simpler, no conflicts)
- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
- id: black
language_version: python3
files: \.py$
exclude: ^(\.venv/|venv/|env/|__pycache__/|\.git/|site-packages/)
# Commented out flake8 - only reports issues, doesn't auto-fix
# - repo: https://github.com/PyCQA/flake8
# rev: 7.3.0
# hooks:
# - id: flake8
# args: ['--max-line-length=88', '--extend-ignore=E203,W503']
# files: \.py$
# exclude: ^(\.venv/|venv/|env/|__pycache__/|\.git/|site/)