-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
superfluous_disable_command reports violations on words in comment that are not rules #2623
Comments
This is intentional as you can disable/enable several rules with the same command. It shouldn't warn several times for the same violation though. See #2348. |
We're migrating from 0.26 version. We have a lot of comments why we disable some rules in code. For example:
What options do we have to keep annotations on disabled rules? |
You can move the comment to a new line before or after the disable command. |
Would a PR adding a delimiter be considered / possible? " - " comes to mind as a way to express "this is now documentation, not a new rule" |
New Issue Checklist
Describe the bug
Swiftlint reports violations for extraneous words in the same comment that follow the swiftlint rule. Many of our team have written disables that look like the one below in the example. Swiftlint should not report a violation for words that it finds that are not known rules.
The example below also reports the correct violation 79 times when I would expect only one. In combination this results in excessive reporting in some situations with the 7 lines of code below reporting 869 violations which is 11 full repeats.
Complete output when running SwiftLint, including the stack trace and command used
Environment
SwiftLint version (run
swiftlint version
to be sure)?0.30.1
Installation method used (Homebrew, CocoaPods, building from source, etc)?
Built from source
Paste your configuration file:
base configuration
Are you using nested configurations?
No
Which Xcode version are you using (check
xcode-select -p
)?10.1 (10B61)
Do you have a sample that shows the issue?
Yes
Full Output:
output.txt
The text was updated successfully, but these errors were encountered: