-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlefthook.yml
116 lines (109 loc) · 3.11 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
109
110
111
112
113
114
115
116
pre-commit:
parallel: true
commands:
rubocop:
glob: "*.rb"
run: bundle exec rubocop --parallel {staged_files}
stree:
glob: "*.rb"
run: |
if test -f .streerc; then
bundle exec stree check {staged_files}
else
echo "Stree config not detected for this repository. Skipping."
fi
prettier:
glob: "*.{js,gjs}"
include: "assets/javascripts|test/javascripts"
run: yarn prettier --list-different {staged_files}
prettier-scss:
glob: "*.scss"
include: "assets/stylesheets"
run: yarn prettier --list-different {staged_files}
prettier-hbs:
glob: "*.hbs"
include: "assets/javascripts|test/javascripts"
run: yarn prettier --list-different {staged_files}
eslint:
glob: "*.{js,gjs}"
include: "assets/javascripts|test/javascripts"
run: yarn eslint -f compact {staged_files}
commands: &commands
bundle-install:
files: git diff --name-only HEAD main
glob: "{Gemfile,Gemfile.lock,*.gemspec}"
run: bundle install
yarn-install:
files: git diff --name-only HEAD main
glob: "{package.json,yarn.lock}"
run: yarn install
post-checkout:
commands: *commands
post-merge:
commands: *commands
post-rewrite:
commands: *commands
fix-staged:
commands:
rubocop:
glob: "*.rb"
run: bundle exec rubocop -a --parallel {staged_files}
stree:
glob: "*.rb"
run: |
if test -f .streerc; then
bundle exec stree write {staged_files}
else
echo "Stree config not detected for this repository. Skipping."
fi
prettier:
glob: "*.{js,gjs,hbs,scss}"
include: "assets/javascripts|assets/stylesheets|test/javascripts"
run: yarn prettier --write {staged_files}
fix-all:
commands:
rubocop:
glob: "*.rb"
run: bundle exec rubocop -a --parallel {all_files}
stree:
glob: "*.rb"
run: |
if test -f .streerc; then
bundle exec stree write {all_files}
else
echo "Stree config not detected for this repository. Skipping."
fi
prettier:
glob: "*.{js,gjs,hbs,scss}"
include: "assets/javascripts|assets/stylesheets|test/javascripts"
run: yarn prettier --write {all_files}
lints:
parallel: true
commands:
rubocop:
glob: "*.rb"
run: bundle exec rubocop --parallel
stree:
glob: "*.rb"
run: |
if test -f .streerc; then
bundle exec stree check {staged_files}
else
echo "Stree config not detected for this repository. Skipping."
fi
prettier:
glob: "*.{js,gjs}"
include: "assets/javascripts|test/javascripts"
run: yarn prettier --list-different {all_files}
prettier-hbs:
glob: "*.hbs"
include: "assets/javascripts|test/javascripts"
run: yarn prettier --list-different {all_files}
prettier-scss:
glob: "*.scss"
include: "assets/stylesheets"
run: yarn prettier --list-different {all_files}
eslint-assets-js:
run: yarn eslint assets/javascripts
eslint-test-js:
run: yarn eslint test/javascripts