Skip to content
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

Enable the superfluous_disable_command when running the analyzer #5522

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@
[phlippieb](https://github.com/phlippieb)
[#5471](https://github.com/realm/SwiftLint/issues/5471)

* The `superfluous_disable_command` rule will now be enabled for the `analyze`
command, unless it has been disabled, and will warn about superfluous
disablement of analyzer rules.
SimplyDanny marked this conversation as resolved.
Show resolved Hide resolved
[Martin Redington](https://github.com/mildm8nnered)
[#4792](https://github.com/realm/SwiftLint/issues/4792)

#### Bug Fixes

* Silence `discarded_notification_center_observer` rule in closures. Furthermore,
Expand Down
2 changes: 1 addition & 1 deletion Source/SwiftLintCore/Models/Linter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public struct Linter {
if compilerArguments.isEmpty {
return !(rule is any AnalyzerRule)
}
return rule is any AnalyzerRule
return rule is any AnalyzerRule || rule is SuperfluousDisableCommandRule
}
self.rules = rules
self.isCollecting = rules.contains(where: { $0 is any AnyCollectingRule })
Expand Down