Run Rubocop Against Modified Files

December 16, 2013

If you are using RuboCop and like me you are working with some legacy codebase you may be interested in running this tool only against the files you’ve modified. Following snippet will do exactly that:

git status --porcelain | cut -c4- | grep '.rb' | xargs rubocop

More convenient script may be found here.

blog comments powered by Disqus