mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 08:56:36 +08:00
0872a1182d
Overcommit uses prebuilt hooks and require global installation. To avoid this issues replace it with Lefthook. Lefthook will be installed with npm packages. New contributors will have fully consistent git hooks.
50 lines
1.3 KiB
YAML
50 lines
1.3 KiB
YAML
pre-commit:
|
|
parallel: true
|
|
commands:
|
|
rubocop:
|
|
glob: '*.rb'
|
|
run: bundle exec rubocop {staged_files}
|
|
eslint:
|
|
glob: '*.{js,es6}'
|
|
run: yarn eslint --ext .es6 -f compact {staged_files}
|
|
yaml-syntax:
|
|
glob: '*.{yaml,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:
|
|
run: yarn prettier --list-different app/assets/stylesheets/**/*.scss app/assets/javascripts/**/*.es6 test/javascripts/**/*.es6
|
|
eslint-assets:
|
|
run: yarn eslint --ext .es6 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
|