forked from discourse/discourse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lefthook.yml
65 lines (60 loc) · 2.1 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
pre-commit:
parallel: true
commands:
rubocop:
glob: "*.rb"
run: bundle exec rubocop {staged_files}
prettier:
glob: "*.{js,es6}"
exclude: "vendor/*|fixtures|public/javascripts|shims.js|ember-addons|template-lintrc|locale/*|test_helper|run-qunit"
run: yarn prettier --list-different {staged_files}
eslint-es6:
glob: "*.es6"
exclude: "vendor/*|fixtures|public/javascripts|shims.js|ember-addons|template-lintrc|locale/*|test_helper|run-qunit"
run: yarn eslint --ext .es6 -f compact {staged_files}
eslint-js:
glob: "*.js"
exclude: "vendor/*|fixtures|public/javascripts|shims.js|ember-addons|template-lintrc|locale/*|test_helper|run-qunit"
run: yarn eslint -f compact {staged_files}
ember-template-lint:
run: yarn run 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}
commands: &commands
bundle-install:
files: git diff --name-only HEAD master
glob: "{Gemfile,Gemfile.lock,*.gemspec}"
run: bundle install
yarn-install:
files: git diff --name-only HEAD master
glob: "{package.json,yarn.lock}"
run: yarn install
post-checkout:
commands: *commands
post-merge:
commands: *commands
post-rewrite:
commands: *commands
lints:
parallel: true
commands:
rubocop:
run: bundle exec rubocop --parallel
prettier:
glob: "{app/assets/stylesheets/**/*.scss,app/assets/javascripts/**/*.es6,test/javascripts/**/*.es6}"
run: yarn prettier --list-different {all_files}
eslint-assets-es6:
run: yarn eslint --ext .es6 app/assets/javascripts
eslint-assets-js:
run: yarn eslint app/assets/javascripts
eslint-test:
run: yarn eslint --ext .es6 test/javascripts
eslint-plugins-assets:
run: yarn eslint --ext .es6 plugins/**/assets/javascripts
eslint-plugins-test:
run: yarn eslint --ext .es6 plugins/**/test/javascripts
eslint-assets-tests:
run: yarn eslint app/assets/javascripts test/javascripts