-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlefthook.yml
108 lines (104 loc) · 2.73 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
check:
parallel: true
commands:
check-prettier:
files: &modified-files git ls-files -m
run: npx prettier --check {files}
glob: "*.{js,jsx,ts,tsx,css,md,html,json,yaml,yml}"
tags: js
check-eslint:
files: *modified-files
run: npx eslint --report-unused-disable-directives --no-warn-ignored {files}
glob: "*.{js,jsx,ts,tsx}"
tags: js
check-tsc:
run: npx tsc --build
glob: "*.{ts,tsx}"
tags: js
check-sorbet:
run: bundle exec srb tc
glob: "*.{rb,rbi}"
tags: rb
check-rubocop:
files: *modified-files
run: bin/rubocop --force-exclusion {files}
glob: "*.{rb,rbi}"
tags: rb
check-mypy:
files: *modified-files
run: poetry run mypy --no-incremental {files}
glob: "*.py"
tags: py
check-black:
files: *modified-files
run: poetry run black --check {files}
glob: "*.py"
tags: py
fix:
commands:
fix-prettier:
files: &modified-files git ls-files -m
run: npx prettier --write {files}
glob: "*.{js,jsx,ts,tsx,css,md,html,json,yaml,yml}"
tags: js
fix-eslint:
files: *modified-files
run: npx eslint --report-unused-disable-directives --no-warn-ignored --fix {files}
glob: "*.{js,jsx,ts,tsx}"
tags: js
fix-rubocop:
files: *modified-files
run: bin/rubocop --force-exclusion --safe-auto-correct {files}
glob: "*.{rb,rbi}"
tags: rb
check-mypy:
files: *modified-files
run: poetry run mypy {files}
glob: "*.py"
tags: py
check-black:
files: *modified-files
run: poetry run black /node_modules/ {files}
glob: "*.py"
tags: py
audit: &audit
parallel: true
commands:
audit-packages:
run: npm audit
tags: js
audit-gems:
run: bin/rails bundle:audit
tags: rb
pre-commit:
parallel: true
commands:
check-prettier:
run: npx prettier --check --cache {staged_files}
glob: "*.{js,jsx,ts,tsx,css,md,html,json,yaml,yml}"
tags: js
check-eslint:
run: npx eslint --report-unused-disable-directives --no-warn-ignored --cache {staged_files}
glob: "*.{js,jsx,ts,tsx}"
tags: js
check-tsc:
run: npx tsc --build
glob: "*.{ts,tsx}"
tags: js
check-sorbet:
run: bundle exec srb tc --cache-dir ./tmp/sorbet
glob: "*.{rb,rbi}"
tags: rb
check-rubocop:
run: bin/rubocop --force-exclusion --cache=true {staged_files}
glob: "*.{rb,rbi}"
tags: rb
check-mypy:
run: poetry run mypy --incremental {staged_files}
glob: "*.py"
tags: py
check-black:
run: poetry run black --check {staged_files}
glob: "*.py"
tags: py
pre-push: *audit