forked from mdn/content
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlefthook.yml
66 lines (57 loc) · 1.79 KB
/
lefthook.yml
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
pre-commit:
parallel: true
jobs:
- name: Format sidebars
glob: "files/sidebars/*.yaml"
run: yarn content fmt-sidebars
stage_fixed: true
- name: Fix redirects
glob: "files/en-us/_redirects.txt"
run: yarn content fix-redirects en-US && yarn content validate-redirects en-US
stage_fixed: true
- name: Format non-markdown
glob: "*.{js,json,yml,yaml,css,html}"
run: yarn prettier --write --cache {staged_files}
stage_fixed: true
- name: Sort cSpell dictionaries
glob: ".vscode/dictionaries/*.txt"
run: node scripts/sort_and_unique_file_lines.js {staged_files}
stage_fixed: true
- name: Run 'yarn filecheck'
glob: "*.{svg,png,jpeg,jpg,gif}"
run: yarn filecheck {staged_files}
- name: Check URL issues
glob: "files/**/*.md"
run: node scripts/log-url-issues.js
- name: Front matter tests
glob: "tests/**/*.*"
run: yarn test:front-matter-linter
- name: Fix markdown
glob: "*.md"
group:
parallel: true
jobs:
- name: Front matter
run: node scripts/front-matter_linter.js --fix true {staged_files}
stage_fixed: true
- name: Markdownlint
run: yarn markdownlint-cli2 --fix {staged_files}
stage_fixed: true
- name: Prettier
run: yarn prettier --write --cache {staged_files}
stage_fixed: true
- name: Check changed xrefs
run: yarn node scripts/update-moved-file-links.js --check
post-merge:
commands:
yarn-install-post-merge-main:
run: |
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
if [ "$BRANCH" != "main" ]; then
exit 0
else
yarn install
fi
output:
- summary
- failure