-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
68 lines (61 loc) · 2.06 KB
/
.pre-commit-config.yaml
File metadata and controls
68 lines (61 loc) · 2.06 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
repos:
# Basic file hygiene (fast, reliable)
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
args: ["--maxkb=1024"]
exclude: "^public_html/src/video/"
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
# Run repository-level formatting targets for changed files
- repo: local
hooks:
- id: format-go
name: format-go (gofmt)
entry: make format-go
language: system
pass_filenames: false
files: ^.*\.go$
stages: [pre-commit]
- id: format-python
name: format-python (black/ruff in data/ & tools/)
entry: make format-python
language: system
pass_filenames: false
# Only run the repo-level python formatter on utility and data scripts
files: ^(tools|data)/.*\.py$
stages: [pre-commit]
- id: format-web
name: format-web (prettier in web/ & docs/)
entry: make format-web
language: system
pass_filenames: false
files: ^(web/|docs/).*(\.js|\.ts|\.svelte|\.css|\.json)$
stages: [pre-commit]
- id: format-mac
name: format-mac (swift-format for macOS visualiser)
entry: make format-mac
language: system
pass_filenames: false
files: ^tools/visualiser-macos/.*\.swift$
stages: [pre-commit]
- id: format-docs
name: format-docs (prettier for Markdown files)
entry: make format-docs
language: system
pass_filenames: false
files: \.md$
exclude: ^(public_html|web|tools/visualiser-macos/(build|DerivedData))/
stages: [pre-commit]
- id: format-sql
name: format-sql (sql-formatter for SQL scripts)
entry: make format-sql
language: system
pass_filenames: false
files: \.sql$
stages: [pre-commit]
# Note: Go formatting and linting handled by your editor/IDE
# Note: Web linting (pnpm) handled by CI on PRs
# This keeps pre-commit fast and reliable!