Skip to content

Instantly share code, notes, and snippets.

@skatkov
Created June 10, 2020 12:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skatkov/d818b9cb3927963e5bbdf718e3ba6f4c to your computer and use it in GitHub Desktop.
Save skatkov/d818b9cb3927963e5bbdf718e3ba6f4c to your computer and use it in GitHub Desktop.
lefthook config
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