generated from P-manBrown/docker-rails-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlefthook.yml
25 lines (25 loc) · 886 Bytes
/
lefthook.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
min_version: 1.3.0
pre-commit:
parallel: true
commands:
rubocop:
glob: '*.{rb,erb}'
run: bin/bundle exec rubocop --autocorrect --force-exclusion {staged_files}
stage_fixed: true
fail_text: 'Read the report above.'
htmlbeautifier:
glob: '*.erb'
run: bin/bundle exec htmlbeautifier {staged_files}
stage_fixed: true
debride:
glob: '*.rb'
run: bin/bundle exec debride --rails -w debride-whitelist.txt {all_files} | tee /dev/tty | grep -q 'LOC:\ 0'
fail_text: 'Read the report above.'
protect-branch:
run: git branch --show-current | tee /dev/tty | grep -Eqvx 'main'
fail_text: "ERROR: Do NOT commit directly to 'main' branch."
pre-push:
commands:
check-git-clean:
run: test -z "$(git status --porcelain | tee /dev/tty)"
fail_text: 'ERROR: Commit or stash changes before pushing.'