Checking for rubocop offenses in a given file

Public, Testing / TDD


Created: Nov 07, 2017     Updated: Nov 07, 2017

You can check what is/is not passing rubocop for a given file by calling:

rubocop app/whatever/whatever/my_file.rb

You can get even more output by passing it the -D flag, which adds the actual name of the cop.

rubocop app/whatever/whatever/my_file.rb -D

The -a flag autocorrects the issue. So you can see what it’s looking for, incase it’s a mystery.