Last active
January 4, 2022 17:58
-
-
Save HarlemSquirrel/c4f63e8811804d9d57094499760dce71 to your computer and use it in GitHub Desktop.
A pre-commit file for Ruby on Rails applications
This file contains 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
#!/bin/bash | |
# | |
# A set of commands to run as pre-commit hooks for git. | |
# | |
# Save this to .git/hooks/pre-commit and make executable to enable | |
# | |
# This will run whenever we run `git commit`. | |
# To skip this, add `-n` or `--no-verify` flag. | |
# | |
set -e | |
printf "Running pre-commit hooks...\n" | |
## | |
# Check for lints with stylelint | |
printf "===> Running stylelint\n" | |
npx stylelint app/assets/**/*css | |
## | |
# Perform static analysis with Rubocop | |
printf "===> Running rubocop\n" | |
bundle exec rubocop --parallel --cache true --disable-pending-cops --format quiet | |
printf "===> OK 👍\n\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment