forked from rubocop/rubocop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix rubocop#4001] Fix bug in Metrics/LineLength
Metrics/LineLength had a bug when configured with “ignoreCopDirectives” set to true AND checking a line with both directive # and non-directive # present. For example: ```rb aaa … aaa # bbb … bbb # rubocop:disable CopName ``` where (aaa … aaa # bbb … bbb) exceeds the specified line length. The cop would correctly detect it as a violation, but would return the extraneous characters AND the directive in the error message. ```rb LARGE_DATA_STRING_PATTERN = %r{\A([A-Za-z0-9\+\/#]…)} # rubocop:disable CopName ``` The above line has # as part of regexp and the line is longer than the permissible line length before the directive. The cop did not detect it as a violation.
- Loading branch information
1 parent
d31464e
commit 7b5f7e2
Showing
4 changed files
with
36 additions
and
2 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