-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
75 lines (70 loc) · 2.21 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
75 lines (70 loc) · 2.21 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
repos:
# Standard file checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: '\.min\.(js|css)$'
- id: end-of-file-fixer
exclude: '(\.min\.(js|css)$|^demos/.*\.(js|css)$)'
- id: check-yaml
args: ['--allow-multiple-documents']
- id: check-added-large-files
args: ['--maxkb=1000']
exclude: '^demos/.*\.(js|css)$'
- id: check-merge-conflict
- id: check-json
- id: mixed-line-ending
args: ['--fix=lf']
# Jekyll/Pug build check - catches syntax errors before commit.
# Uses --limit_posts 5 for speed (~3s vs 180s+); full-site build runs in CI.
- repo: local
hooks:
- id: jekyll-build
name: Jekyll Build Test (scoped)
entry: make jekyll-build-precommit
language: system
pass_filenames: false
always_run: false
files: '(_includes/|_layouts/|_posts/|_pages/|_config\.yml|Gemfile)'
stages: [pre-commit]
verbose: true
# CSS checks
- repo: local
hooks:
- id: build-css
name: Build CSS
entry: npm run build:css
language: system
pass_filenames: false
files: 'assets/css/.*\.css$|tailwind\.config\.js'
stages: [pre-commit]
# Pug template checks
- repo: local
hooks:
- id: check-pug-syntax
name: Check Pug Class Syntax
entry: python3 scripts/precommit/check_pug_class_syntax.py
language: system
pass_filenames: false
files: '\.pug$'
stages: [pre-commit]
# OG image generation for blog posts
- repo: local
hooks:
- id: generate-og-images
name: Generate OG Images
entry: uv run --with pillow,pyyaml python3 scripts/generate_og_images.py --stage --paths
language: system
pass_filenames: true
files: '(_posts/.*\.md|scripts/generate_og_images\.py|_config\.yml)'
stages: [pre-commit]
# Markdown link checks
- repo: local
hooks:
- id: check-markdown-links
name: Check Markdown Links
entry: python3 scripts/precommit/check_markdown_links.py
language: system
files: '\.md$'
stages: [pre-commit]