-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated channel and documentation to Rubocop v0.80.0 (#225)
* Updated channel and documentation to Rubocop v0.79.0 (#222) * Bumps 'rubocop' Dependency to v0.80.0 * Updates Scraped Documentation * Handles Edge-Case in Documentation Parsing Logic If a cop's documentation grows too long (e.g. Style/BlockDelimiters), it will run afoul of the Metrics/ClassLength cop, which will need to be disabled. This breaks the parsing. Adjusting the initial gsub's regexp pattern appears to resolve this edge-case. * Minor Delinting * Fixes Namespace Warnings in Config Files * Possible Fix for Config Upgrader Spec I'm not sure what the desired outcome here is, actually. * Updates ConfigUpgrader Spec Per feedback from @filipesperandio, the config upgrader spec will now exercise the upgrades with the new cops enabled, rather than disabled. Co-authored-by: Filipe Esperandio <filipesperandio@gmail.com>
- Loading branch information
1 parent
d5a72b9
commit 40707a5
Showing
24 changed files
with
435 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
This cop checks that there is an `# rubocop:enable ...` statement | ||
after a `# rubocop:disable ...` statement. This will prevent leaving | ||
cop disables on wide ranges of code, that latter contributors to | ||
a file wouldn't be aware of. | ||
|
||
### Example: | ||
# Lint/MissingCopEnableDirective: | ||
# MaximumRangeSize: .inf | ||
|
||
# good | ||
# rubocop:disable Layout/SpaceAroundOperators | ||
x= 0 | ||
# rubocop:enable Layout/SpaceAroundOperators | ||
# y = 1 | ||
# EOF | ||
|
||
# bad | ||
# rubocop:disable Layout/SpaceAroundOperators | ||
x= 0 | ||
# EOF | ||
|
||
### Example: | ||
# Lint/MissingCopEnableDirective: | ||
# MaximumRangeSize: 2 | ||
|
||
# good | ||
# rubocop:disable Layout/SpaceAroundOperators | ||
x= 0 | ||
# With the previous, there are 2 lines on which cop is disabled. | ||
# rubocop:enable Layout/SpaceAroundOperators | ||
|
||
# bad | ||
# rubocop:disable Layout/SpaceAroundOperators | ||
x= 0 | ||
x += 1 | ||
# Including this, that's 3 lines on which the cop is disabled. | ||
# rubocop:enable Layout/SpaceAroundOperators |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,22 @@ | ||
# The Lint/RedundantCopDisableDirective cop needs to be disabled so as | ||
# to be able to provide a (bad) example of a redundant disable. | ||
# rubocop:disable Lint/RedundantCopDisableDirective | ||
# rubocop:disable Lint/RedundantCopDisableDirective | ||
This cop detects instances of rubocop:disable comments that can be | ||
removed without causing any offenses to be reported. It's implemented | ||
as a cop in that it inherits from the Cop base class and calls | ||
add_offense. The unusual part of its implementation is that it doesn't | ||
have any on_* methods or an investigate method. This means that it | ||
doesn't take part in the investigation phase when the other cops do | ||
their work. Instead, it waits until it's called in a later stage of the | ||
execution. The reason it can't be implemented as a normal cop is that | ||
it depends on the results of all other cops to do its work. | ||
|
||
|
||
### Example: | ||
# bad | ||
# rubocop:disable Layout/LineLength | ||
x += 1 | ||
# rubocop:enable Layout/LineLength | ||
|
||
# good | ||
x += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,28 @@ | ||
# The Lint/RedundantCopEnableDirective cop needs to be disabled so as | ||
# to be able to provide a (bad) example of an unneeded enable. | ||
# rubocop:disable Lint/RedundantCopEnableDirective | ||
# rubocop:disable Lint/RedundantCopEnableDirective | ||
This cop detects instances of rubocop:enable comments that can be | ||
removed. | ||
|
||
When comment enables all cops at once `rubocop:enable all` | ||
that cop checks whether any cop was actually enabled. | ||
### Example: | ||
# bad | ||
foo = 1 | ||
# rubocop:enable Layout/LineLength | ||
|
||
# good | ||
foo = 1 | ||
### Example: | ||
# bad | ||
# rubocop:disable Style/StringLiterals | ||
foo = "1" | ||
# rubocop:enable Style/StringLiterals | ||
baz | ||
# rubocop:enable all | ||
|
||
# good | ||
# rubocop:disable Style/StringLiterals | ||
foo = "1" | ||
# rubocop:enable all | ||
baz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Detects double disable comments on one line. This is mostly to catch | ||
automatically generated comments that need to be regenerated. | ||
|
||
### Example: | ||
# bad | ||
def f # rubocop:disable Style/For # rubocop:disable Metrics/AbcSize | ||
end | ||
|
||
# good | ||
# rubocop:disable Metrics/AbcSize | ||
def f # rubocop:disable Style/For | ||
end | ||
# rubocop:enable Metrics/AbcSize | ||
|
||
# if both fit on one line | ||
def f # rubocop:disable Style/For, Metrics/AbcSize | ||
end |
Oops, something went wrong.