Skip to content

Instantly share code, notes, and snippets.

@prathe
Last active August 31, 2023 20:27
Show Gist options
  • Save prathe/98ab93195ad45ecb7cb0935cce06a60d to your computer and use it in GitHub Desktop.
Save prathe/98ab93195ad45ecb7cb0935cce06a60d to your computer and use it in GitHub Desktop.
Git Rspec/Rubocop commands
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
@prathe
Copy link
Author

prathe commented Oct 27, 2022

git diff json-api-v3-squashed... --diff-filter=d --name-only | egrep "\.rb$" |xargs bundle exec rubocop

@prathe
Copy link
Author

prathe commented Dec 13, 2022

rubocop -a -c .rubocop_exclusion.yml path/to/files

@prathe
Copy link
Author

prathe commented Jan 12, 2023

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

@prathe
Copy link
Author

prathe commented Jan 27, 2023

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