ga-wdi-boston / ruby-object-model

Other
1 stars 109 forks source link

Appease rubocop #25

Open BenGitsCode opened 7 years ago

BenGitsCode commented 7 years ago

We may need to ignore some i.e. spec/equine_spec.rb:1:1: W: Unnecessary disabling of Metrics/BlockLength. but the frozen string literal comments should definitely be fixed.

〉 rake nag
Running RuboCop...
Inspecting 15 files
.....CCC.C...W.

Offenses:

lib/album.rb:1:1: C: Missing frozen string literal comment.
# A class of albums
^
lib/car.rb:1:1: C: Missing frozen string literal comment.
# define Class Car
^
lib/equine.rb:1:1: C: Missing top-level class documentation comment.
class Equine
^^^^^
lib/equine.rb:1:1: C: Missing frozen string literal comment.
class Equine
^
lib/equine.rb:2:3: C: Put empty method definitions on a single line.
  def eat_grass ...
  ^^^^^^^^^^^^^
lib/equine.rb:6:1: C: Missing top-level module documentation comment.
module Ridable
^^^^^^
lib/equine.rb:7:3: C: Put empty method definitions on a single line.
  def ride ...
  ^^^^^^^^
lib/equine.rb:11:1: C: Missing top-level class documentation comment.
class Horse < Equine
^^^^^
lib/equine.rb:15:1: C: Missing top-level class documentation comment.
class Mule < Equine
^^^^^
lib/sleeper.rb:1:1: C: Missing frozen string literal comment.
# define module Sleeper
^
spec/equine_spec.rb:1:1: W: Unnecessary disabling of Metrics/BlockLength.
# rubocop:disable BlockLength
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/equine_spec.rb:1:1: C: Missing frozen string literal comment.
# rubocop:disable BlockLength
^

15 files inspected, 12 offenses detected
RuboCop failed!
jrhorn424 commented 7 years ago

spec/equine_spec.rb:1:1: W: Unnecessary disabling of Metrics/BlockLength. Should be handled by the .rubocop.yml, no?

BenGitsCode commented 7 years ago

I wasn't sure about that one.

Reading this https://github.com/bbatsov/rubocop/issues/3664#issuecomment-275860483, it sounds like it depends on which version. If we're planning to continue at 0.46.0 we should be to include something like this in the .rubocop.yml


Metrics/BlockLength:
  Exclude:
    - "**/*_spec.rb"
raq929 commented 7 years ago

Yes. The disabling of Metrics/Blocklength in a comment should be removed, as it is now covered by .rubocop.yml.