forked from discourse/discourse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lefthook.yml
77 lines (74 loc) · 2.27 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
skip_output:
- meta
- success
pre-commit:
parallel: true
skip:
- merge
- rebase
commands:
rubocop:
glob: "*.rb"
run: bundle exec rubocop --parallel --force-exclusion {staged_files}
syntax_tree:
glob: "*.{rb,rake}"
run: bundle exec stree check Gemfile {staged_files}
prettier:
glob: "*.js"
include: "app/assets/javascripts|plugins/.+?/assets/javascripts"
run: pnpm pprettier --list-different {staged_files}
prettier-scss:
glob: "*.scss"
include: "app/assets/stylesheets|plugins/.+?/assets/stylesheets"
run: pnpm pprettier --list-different {staged_files}
eslint:
glob: "*.js"
include: "app/assets/javascripts|plugins/.+?/assets/javascripts"
run: pnpm eslint -f compact --quiet {staged_files}
ember-template-lint:
glob: "*.hbs"
include: "app/assets/javascripts|plugins/.+?/assets/javascripts"
run: pnpm ember-template-lint {staged_files}
yaml-syntax:
glob: "*.{yaml,yml}"
# database.yml is an erb file not a yaml file
exclude: "database.yml"
run: bundle exec yaml-lint {staged_files}
i18n-lint:
glob: "**/{client,server}.en.yml"
run: bundle exec ruby script/i18n_lint.rb {staged_files}
fix-staged:
parallel: false
commands:
prettier:
glob: "*.js"
include: "app/assets/javascripts|plugins/.+?/assets/javascripts"
run: pnpm pprettier --write {staged_files}
rubocop:
glob: "*.rb"
run: bundle exec rubocop --force-exclusion -A {staged_files}
syntax_tree:
glob: "*.{rb,rake}"
run: bundle exec stree write Gemfile {staged_files}
lints:
parallel: true
commands:
rubocop:
glob: "*.rb"
run: bundle exec rubocop --parallel
prettier:
run: pnpm pprettier --list-different **/*.js
prettier-scss:
run: pnpm pprettier --list-different **/*.scss
eslint:
run: pnpm eslint -f compact --quiet --ext .js .
ember-template-lint:
run: pnpm ember-template-lint .
yaml-syntax:
glob: "*.{yaml,yml}"
# database.yml is an erb file not a yaml file
exclude: "database.yml"
run: bundle exec yaml-lint {all_files}
i18n-lint:
glob: "**/{client,server}.en.yml"
run: bundle exec ruby script/i18n_lint.rb {all_files}