Last active
August 31, 2023 20:27
-
-
Save prathe/98ab93195ad45ecb7cb0935cce06a60d to your computer and use it in GitHub Desktop.
Git Rspec/Rubocop commands
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
bundle exec rubocop -c .rubocop_exclusion.yml --fail_level convention --display-only-fail-level-offenses | |
# Rubocop only files I modified/added, but not the one I deleted | |
git diff develop... --diff-filter=d --name-only | egrep "\\.rb$" |xargs bundle exec rubocop | |
git diff develop... --diff-filter=d --name-only | egrep "\\.rb$" |egrep -v db/schema.rb | xargs bundle exec rubocop | |
git diff develop... --diff-filter=d --name-only | egrep "\\.rb$" |egrep -v db/schema.rb | xargs bundle exec rubocop --fail_level convention --display-only-fail-level-offenses | |
git diff develop... --diff-filter=d --name-only | egrep "\\.rb$" |egrep -v db/schema.rb | xargs bundle exec rubocop -c .rubocop_exclusion.yml --fail_level convention --display-only-fail-level-offenses | |
git diff develop... --diff-filter=d --name-only | egrep "\\.rb$" |egrep -v db/schema.rb | xargs bundle exec rubocop -A -c .rubocop_exclusion.yml --fail_level convention | |
git diff --name- | |
# -A the staged | |
git st | egrep -o "(\w+|[/-]+)+\\.rb$" |egrep -v db/schema.rb | xargs bundle exec rubocop -A -c .rubocop_exclusion.yml --fail_level conventiononly | egrep "\.rb$" |xargs bundle exec rubocop | |
# RSpec only files I modified/added, but not the one I deleted | |
git diff develop... --diff-filter=d --name-only | egrep "_spec\\.rb$" |xargs bin/rspec | |
git diff --name-only | egrep "_spec\\.rb$" |xargs bin/rspec | |
# Treeview of added/modified | |
git diff develop... --diff-filter=d --name-only | tree --fromfile |
git diff json-api-v3-squashed... --diff-filter=d --name-only | egrep "\.rb$" |egrep -v db/schema.rb | xargs bundle exec rubocop -A -c .rubocop_exclusion.yml --fail_level convention
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
git diff json-api-v3-squashed... --diff-filter=d --name-only | egrep "\.rb$" |egrep -v db/schema.rb | xargs bundle exec rubocop -c .rubocop_exclusion.yml --fail_level convention --display-only-fail-level-offenses