Last active
April 22, 2019 16:51
-
-
Save aaronklaassen/158aa22d66e44e021f3f5054312d4382 to your computer and use it in GitHub Desktop.
But you told me you'd never forget!
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
#!/usr/bin/env ruby | |
status = `git status -s` | |
ignore = ["db/schema.rb"] | |
check = status.split("\n") | |
.select { |line| ["A", "M"].include?(line[0..1].strip) } | |
.select { |line| line[-3..-1] == ".rb" } | |
.map { |line| line[3..-1] } | |
check -= ignore | |
ok = system("rubocop -R #{check.join(' ')}") | |
exit(ok) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just because bash nerd