Brew: Cleanup RuboCop todos

Created on 21 Sep 2018  Â·  8Comments  Â·  Source: Homebrew/brew

We have a .rubocop_todo.yml and some TODOs in our .rubocop.yml that it'd be great to clean up.

These would be a good first issue to fix one of each of these TODO at a time in separate pull requests.

help wanted outdated

All 8 comments

I get

➜  Homebrew git:(master) rubocop
.rubocop_todo.yml: RSpec/FilePath has the wrong namespace - should be Rails
Warning: unrecognized cop RSpec/AnyInstance found in .rubocop_todo.yml
Warning: unrecognized cop RSpec/ContextWording found in .rubocop_todo.yml
Warning: unrecognized cop RSpec/DescribeClass found in .rubocop_todo.yml
Warning: unrecognized cop RSpec/ExampleLength found in .rubocop_todo.yml
Warning: unrecognized cop RSpec/ExpectActual found in .rubocop_todo.yml
Warning: unrecognized cop RSpec/ExpectInHook found in .rubocop_todo.yml
Warning: unrecognized cop RSpec/InstanceVariable found in .rubocop_todo.yml
Warning: unrecognized cop RSpec/MessageSpies found in .rubocop_todo.yml
Warning: unrecognized cop RSpec/MissingExampleGroupArgument found in .rubocop_todo.yml
Warning: unrecognized cop RSpec/MultipleDescribes found in .rubocop_todo.yml
Warning: unrecognized cop RSpec/MultipleExpectations found in .rubocop_todo.yml
Warning: unrecognized cop RSpec/NamedSubject found in .rubocop_todo.yml
Warning: unrecognized cop RSpec/NestedGroups found in .rubocop_todo.yml
Warning: unrecognized cop RSpec/RepeatedDescription found in .rubocop_todo.yml
Warning: unrecognized cop RSpec/RepeatedExample found in .rubocop_todo.yml
Warning: unrecognized cop RSpec/SubjectStub found in .rubocop_todo.yml
Warning: unrecognized cop RSpec/VerifiedDoubles found in .rubocop_todo.yml
Warning: unrecognized cop RSpec/AnyInstance found in .rubocop.yml
Warning: unrecognized cop RSpec/ContextWording found in .rubocop.yml
Warning: unrecognized cop RSpec/DescribeClass found in .rubocop.yml
Warning: unrecognized cop RSpec/ExampleLength found in .rubocop.yml
Warning: unrecognized cop RSpec/ExpectActual found in .rubocop.yml
Warning: unrecognized cop RSpec/ExpectInHook found in .rubocop.yml
Warning: unrecognized cop RSpec/InstanceVariable found in .rubocop.yml
Warning: unrecognized cop RSpec/MessageSpies found in .rubocop.yml
Warning: unrecognized cop RSpec/MissingExampleGroupArgument found in .rubocop.yml
Warning: unrecognized cop RSpec/MultipleDescribes found in .rubocop.yml
Warning: unrecognized cop RSpec/MultipleExpectations found in .rubocop.yml
Warning: unrecognized cop RSpec/NamedSubject found in .rubocop.yml
Warning: unrecognized cop RSpec/NestedGroups found in .rubocop.yml
Warning: unrecognized cop RSpec/RepeatedDescription found in .rubocop.yml
Warning: unrecognized cop RSpec/RepeatedExample found in .rubocop.yml
Warning: unrecognized cop RSpec/SubjectStub found in .rubocop.yml
Warning: unrecognized cop RSpec/VerifiedDoubles found in .rubocop.yml
Inspecting 695 files
.......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................

695 files inspected, no offenses detected
➜  Homebrew git:(master)

Would you happen to know how I can get rubocop to run as it should ?

➜  Homebrew git:(master) gem list | grep rubocop
rubocop (0.59.1)
rubocop-rspec (1.29.1)

@javian Try brew style instead.

ah, that worked a bit better. I can't say that I understand the output though. I get to 695 files inspected, no offenses detected so the offenses in the the rubocop_todo.yml are not highlighted in brew style. How am I supposed to know if a code change has been performed correctly if it doesn't find the offense to begin with ? I must be doing something wrong =)

That's the point of a .rubocop_todo.yml: to stop brew style failing due to existing issues while stopping additional problems from being created. You need to remove or comment out lines from .rubocop_todo.yml in order to see the failures.

Ok I get that so I went ahead and did this

➜  Homebrew git:(master) ✗ git --no-pager diff
diff --git a/Library/Homebrew/.rubocop_todo.yml b/Library/Homebrew/.rubocop_todo.yml
index ac9e850a8..cf43f7679 100644
--- a/Library/Homebrew/.rubocop_todo.yml
+++ b/Library/Homebrew/.rubocop_todo.yml
@@ -131,11 +131,3 @@ RSpec/SubjectStub:
 # Configuration parameters: IgnoreSymbolicNames.
 RSpec/VerifiedDoubles:
   Enabled: false
-
-# Offense count: 1
-# Cop supports --auto-correct.
-# Configuration parameters: EnforcedStyle.
-# SupportedStyles: empty, nil, both
-Style/EmptyElse:
-  Exclude:
-    - 'style.rb'
➜  Homebrew git:(master) ✗

and it still outputs 695 files inspected, no offenses detected so it seems that that has been fixed already since

@@ -30,8 +30,8 @@ RSpec/AnyInstance:
 # Offense count: 139
 # Configuration parameters: Prefixes.
 # Prefixes: when, with, without
-RSpec/ContextWording:
-  Enabled: false
+#RSpec/ContextWording:
+#  Enabled: false

does indeed print the errors on screen.

Cool, that one can be removed then and you can work on others 😉

The todo file has been removed so we should be able to close this issue now @MikeMcQuaid

Cool, thanks @javian!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MikeMcQuaid picture MikeMcQuaid  Â·  3Comments

cfredhart picture cfredhart  Â·  4Comments

zelsonia picture zelsonia  Â·  4Comments

JustinTArthur picture JustinTArthur  Â·  3Comments

hktalent picture hktalent  Â·  4Comments