RuboCop is a Ruby code style checker (linter) and formatter based on the community-driven Ruby Style Guide.
RuboCop is extremely flexible and most aspects of its behavior can be tweaked via various configuration options. In practice RuboCop supports pretty much every (reasonably popular) coding style that you can think of.
Apart from reporting problems in your code, RuboCop can also automatically fix some of the problems for you.
RuboCop supports MRI 2.4+ and JRuby 9.2+.
RuboCop's installation is pretty standard:
$ gem install rubocop
rubocop with no arguments will check all Ruby source files in the current directory:
Alternatively you can specify a list of files and directories to check:
$ rubocop app spec lib/something.rb
You can auto-correct offenses with
$ rubocop -a
-h for available command-line options.