Ruby rubocop

From wikinotes
Revision as of 19:07, 25 May 2021 by Will (talk | contribs) (→‎Usage)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A ruby linter.

Documentation

official docs https://docs.rubocop.org/rubocop/0.90/index.html
github https://github.com/rubocop-hq/rubocop

Usage

rubocop          # test all files
rubocop file.rb  # test single file

rubocop -D file.rb  # print name of rule-failures
# rubocop:disable RuleByName   # <-- disable rubocop rule for line
def foo(a, b, c)
  # ...
end
# rubocop:enable RuleByName   # <-- re-enable rubocop rule for line