Run rubocop with lefthook only on modified lines

Inspired and adapted from
  https://gist.github.com/skanev/9d4bec97d5a6825eaaf6
  https://gist.github.com/MaxLap/ea4b6d1df81de3024562798b5501b9c8
This commit is contained in:
Christophe Bliard
2022-07-01 16:11:02 +02:00
parent e25d2f14ee
commit d1ce52f9f0
2 changed files with 203 additions and 1 deletions
+1 -1
View File
@@ -16,4 +16,4 @@ pre-commit:
rubocop:
files: git diff --name-only --staged
glob: "*.rb"
run: bundle exec rubocop --force-exclusion {files}
run: bin/dirty-rubocop --uncommitted --force-exclusion {files}