forked from game-ci/documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lefthook.yml
44 lines (41 loc) · 1.26 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
# EXAMPLE USAGE
# Refer for explanation to following link:
# https://github.com/evilmartians/lefthook/blob/master/docs/full_guide.md
#
color: true
extends: {}
#pre-push:
# parallel: true
# commands:
# packages-audit:
# tags: security
# run: yarn audit
pre-commit:
parallel: true
commands:
format documents:
glob: '*.{md,mdx}'
exclude: '.docusaurus/|build/'
run: yarn prettier --write {staged_files} && git add {staged_files}
format configs:
glob: '*.{json,yml,yaml}'
exclude: '.docusaurus/|build/'
run: yarn prettier --write {staged_files} && git add {staged_files}
format code:
glob: '*.{js,jsx,ts,tsx}'
exclude: '.docusaurus/|build/'
run:
yarn prettier --write {staged_files} && yarn eslint --stdin-filename {staged_files} && git
add {staged_files}
type check:
glob: '*.{ts,tsx,scss}'
exclude: '.docusaurus/|build/'
run: yarn tsc-files
run tests:
glob: '*.{js,jsx,ts,tsx}'
exclude: '.docusaurus/|build/'
run: yarn jest --passWithNoTests --findRelatedTests {staged_files}
make shell script executable:
glob: '*.sh'
exclude: '.docusaurus/|build/'
run: git update-index --chmod=+x {staged_files} && git add {staged_files}