It should be possible to enable superfluous_disable_command
for analyzer rules
#4792
Labels
enhancement
Ideas for improvements of existing features and rules.
New Issue Checklist
New rule request
Not a new rule request per se, but it would be great if we could get warnings about superfluous disables for analyzer rules.
The analyzer is a bit of an obscurity. It took me a while to realise that I had to run analyzer passes separately, and to work out a reasonable way to run them from Xcode.
I'm just doing a big cleanup on analyzer rule hits in my codebase, which are almost always
unused_import
andunused_declaration
hits.Some of these, in my case, require suppression (
// swiftlint:disable unused_declaration
)But there doesn't seem to be anyway to detect, in future, if these suppressions have become superfluous.
Clearly, we wouldn't want hits from
superfluous_disable_command
from analyzer rule suppression when just linting.Also, we would probably want some way to suppress
superfluous_disable_command
from triggering when running the analyzer.In terms of implementation, usability/neatness considerations aside, it almost feels like a separate rule would be one way to accomplish this -
superfluous_disable_analyzer_rule_command
The text was updated successfully, but these errors were encountered: