Fix Rubocop (and therefore CI) #369
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Right now, CI is failing for all pull requests because of Rubocop failures. This PR is three tiers of "fix" to that issue in three commits:
d9b69c4 — Rubocop itself was failing to even run because of out-of-date parameter names.Before this change, you’d get the following error:
[Rebased out because this was done on master in ee80a3c and 64fcb6a]4bc49a7 — once Rubocop was fixed to run at all, it reported hundreds of offenses. This commit fixes all the actual "violations" per the Rubocop YML via
rake rubocop:auto_correct
.b9d6ad1 — Add two new Rubocop directives to account for defaults that shouldn't be considered issues in this codebase.
Set
Metrics/BlockLength
as disabled for thespec
directory. Prior to this change, you get a bunch of failures like:But the blocklength validation doesn’t really make sense when assessing files written with the RSpec DSL, since when written properly, the specs are just very long blocks themselves.
Disable
Style/IndentHeredoc
. For Ruby 2.3+, the recommendation from Rubocop is just to use<<~
or to use "some library (e.g. ActiveSupport's String#strip_heredoc)" for earlier versions of Ruby.However, the places that heredocs are being used are to test the output, and those are actually testing the spacing itself explicitly, so it doesn't make sense to squish the indentation out when it's present in this case anyway.