-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #7620. This PR fixes the following false positive for `Migration/DepartmentName` when a disable comment contains a plain comment. ```console % cat example.rb # rubocop:disable Style/SafeNavigation # support Ruby < 2.3.0 % rubocop --only Migration/DepartmentName Inspecting 1 file C Offenses: example.rb:1:50: C: Migration/DepartmentName: Department name is missing. # rubocop:disable Style/SafeNavigation # support Ruby < 2.3.0 ^^^^ 1 file inspected, 1 offense detected ``` The following is an example disable comment. ```ruby # rubocop:disable Style/FrozenStringLiteralComment, Style/StringLiterals ``` The token used after `# rubocop: disable` are `A-z`, `/`, or `,`. Also `A-z` includes `all`. ```ruby # rubocop:disable all ``` This PR will change the processing of `Migration/DepartmentName` cop to finish when an invalid token is used.
- Loading branch information
Showing
3 changed files
with
22 additions
and
0 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