$apm install linter-rubocop
in your terminal. You can configure the atom plugin by editing ~/.atom/config.cson.
.rubocop.yml
file. This file can be different for each directory in which they are located. Meaning that two folders of the project can have different rubocop configs. It is very tweakable as seen in their .rubocop.yml default file. $rubocop
in the terminal. This will analyze and find all the offenses in the current directory. To run it on a single file simply type $rubocop name_of_the_file.rb
# rubocop:disable Cop/NameOfTheCop
# rubocop:disable Cop/NameOfTheCop
and # rubocop:enable Cop/NameOfTheCop
$rubocop only --lint
for example)eql?
instead of ==
, to use &&
instead of and
, etc... if
, or use if
on one line if possible. It often prefers the use of a guard close than the use of an if
. returns
is not in line with the best practice, so the last line of a method should not include a return
.%w[string string]
and an array of symbol %i[symbol symbol]
. is_a ?
or has_?
. These is_
and has_
should simply be removed as they add nothing to clarity. # rubocop:disable Cop/NameOfTheCop
that is either inline with the offense it tell Rubocop to ignore or that is followed by # rubocop:enable Cop/NameOfTheCop
somewhere below to tell Rubocop to ignore a snippet of code.private
section of the code. This violate the empty lines policy of Rubocop. Therefore it has been decided to not fix these offenses in order for the code to remain clear in our eyes. has_
or is_
predicate in some cases, where it really adds value to the clarity. if
syntaxes even though Rubocop would want us to use guard closes, as they make it a lot easier for a human to comprehend what is going on in the method.eval
method is called. .rubocop.yml
situated directly in seraphinWeb. .rubocp.yml
file. Ideally the metrics spec should not be defined at all in the config file, and there should be a comment disabling Rubocop for each method, class, block or module that we deem worthy enough to outsize Rubocop's requirements.# rubocop:disable Cop/NameOfTheCop
inline to make sure Rubocop doesn't take it into account. object&.[](:key)