-
Notifications
You must be signed in to change notification settings - Fork 1
/
lefthook.yml
33 lines (30 loc) · 1.04 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
# Refer to following link for explanation:
# https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md
# Use this to build commit messages
prepare-commit-msg:
commands:
commitizen:
interactive: true
run: "LEFTHOOK=0;sh -c ': >/dev/tty' > /dev/null 2>&1; if sh -c ': >/dev/tty' >/dev/null 2>/dev/null; then ( exec < /dev/tty && npx cz ) || true 2> /dev/null; fi"
# run: LEFTHOOK=0 && npx cz
# Use this to validate commit messages
commit-msg:
commands:
"lint commit message":
run: npm run lint:commit --edit ${1}
# Use this to lint files before committing
pre-commit:
parallel: true
commands:
lintjs:
glob: "web/app/{themes,plugins}/cbf-*/**/*.js"
run: npm run lint:js -- --fix {staged_files}
stage_fixed: true
lintcss:
glob: "web/app/{themes,plugins}/cbf-*/**/*.{css,scss}"
run: npm run lint:css -- --fix {staged_files}
stage_fixed: true
lintphp:
glob: "web/app/{themes,plugins}/cbf-*/**/*.php"
run: ./.phpcbf {staged_files}
stage_fixed: true