-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.pre-commit-config.yaml
More file actions
70 lines (68 loc) · 2.19 KB
/
Copy path.pre-commit-config.yaml
File metadata and controls
70 lines (68 loc) · 2.19 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
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: |
(?x)^(
.*\.min\.(js|css)$|
.*\.map$|
assets/js/distillpub/.*|
assets/js/search/.*|
_sass/font-awesome/.*|
_scripts/.*|
lighthouse_results/.*|
_data/citations\.yml$
)$
- id: end-of-file-fixer
exclude: |
(?x)^(
.*\.min\.(js|css)$|
.*\.map$|
assets/js/distillpub/.*|
assets/js/search/.*|
_sass/font-awesome/.*|
_scripts/.*|
lighthouse_results/.*|
_data/citations\.yml$
)$
- id: check-yaml
args: [--allow-multiple-documents]
- id: check-added-large-files
exclude: ^assets/video/
- id: check-merge-conflict
- id: check-json
exclude: \.devcontainer/devcontainer\.json$
- id: detect-private-key
# Prettier formatting on commit (auto-fix staged files)
- repo: local
hooks:
- id: prettier
name: prettier
# `--no-install` forces npx to use the local prettier from node_modules
# (pinned in package.json / package-lock.json) instead of silently
# downloading a different version. Run `npm ci` if this errors out.
entry: npx --no-install prettier --write
language: system
files: \.(js|jsx|ts|tsx|css|scss|md|mdx|html|liquid|json|yml|yaml)$
exclude: |
(?x)^(
.*\.min\.(js|css)$|
.*\.map$|
assets/js/distillpub/.*|
assets/js/search/.*|
_sass/font-awesome/.*|
_scripts/.*|
lighthouse_results/.*|
_data/citations\.yml$
)$
# Full repo check on push (matches CI: npx prettier . --check)
- id: prettier-check-all
name: prettier-check-all
entry: npx --no-install prettier . --check
language: system
pass_filenames: false
always_run: true
stages: [pre-push]