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

It should be possible to enable superfluous_disable_command for analyzer rules #4792

Closed
mildm8nnered opened this issue Mar 1, 2023 · 1 comment
Labels
enhancement Ideas for improvements of existing features and rules.

Comments

@mildm8nnered
Copy link
Collaborator

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 and unused_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

@SimplyDanny SimplyDanny added the enhancement Ideas for improvements of existing features and rules. label Mar 2, 2023
@mildm8nnered
Copy link
Collaborator Author

Resolved by #5522

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Ideas for improvements of existing features and rules.
Projects
None yet
Development

No branches or pull requests

2 participants