File tree Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ # Get a list of the staged files
4+ STAGED_RUBY_FILES=$( git diff --cached --name-only --diff-filter=ACMR | sed ' s| |\\ |g' | grep " .rb" )
5+
6+ # If ruby_files string is non-zero
7+ if [ ! -z $STAGED_RUBY_FILES ]
8+ then
9+ echo " [Pre commit hook] Running standardrb linting"
10+
11+ # If standardrb returns a non 0 response, exit
12+ docker compose run --rm --no-deps -T web standardrb $STAGED_RUBY_FILES || exit 1
13+ fi
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ echo " Installing git hooks\n"
4+
5+ echo " Copying contents of .git_hooks into .git/hooks\n"
6+ cp .git_hooks/* .git/hooks
7+
8+ echo " Install complete!"
Original file line number Diff line number Diff line change 11# README
22
3+ ## Development environment setup
4+
5+ ### Pre-Commit Hooks
6+
7+ Everyone should have pre-commit hooks setup!
8+
9+ 1 . Run ` ./install_git_hooks.sh `
10+
11+ 3 . Voila!
12+
313## Structure
414
515- app
You can’t perform that action at this time.
0 commit comments