Created
June 10, 2020 12:25
-
-
Save skatkov/d818b9cb3927963e5bbdf718e3ba6f4c to your computer and use it in GitHub Desktop.
lefthook config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pre-commit: | |
parallel: true | |
commands: | |
eslint: | |
glob: "*.{js}" | |
run: yarn prettier --write {staged_files} && yarn eslint {staged_files} && git add {staged_files} | |
css: | |
glob: "*.{css}" | |
run: yarn prettier --write {staged_files} && git add {staged_files} | |
rubocop: | |
glob: "*.rb" | |
exclude: "application.rb|routes.rb" | |
run: bundle exec rubocop -a --fail-level E && git add {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-merge: | |
commands: *commands | |
post-rewrite: | |
commands: *commands | |
post-checkout: | |
piped: true | |
commands: *commands | |
scripts: | |
db-migrate: | |
tags: backend | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment