Skip to content

Instantly share code, notes, and snippets.

@garybernhardt
Created September 17, 2018 18:34
Show Gist options
  • Select an option

  • Save garybernhardt/c2fceef67bcba989b2742dad88c9170b to your computer and use it in GitHub Desktop.

Select an option

Save garybernhardt/c2fceef67bcba989b2742dad88c9170b to your computer and use it in GitHub Desktop.

Revisions

  1. garybernhardt created this gist Sep 17, 2018.
    8 changes: 8 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    rubocop | egrep ' (W|C): ' | cut -d ' ' -f 3 | sort -u | sed 's/:$//' | while read cop; do
    git checkout .
    rubocop -a --only "$cop";
    if [[ $(git diff --stat) != '' ]]; then
    git add --all
    git commit -m "fix rubocop cop $cop"
    fi
    done