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

`superfluous_disable_command` overrides `disable all` #2670

Closed
fredpi opened this issue Mar 6, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@fredpi
Copy link
Contributor

commented Mar 6, 2019

With the following code...

// swiftlint:disable all
// swiftlint:disable some_rule

... where some_rule isn't violated in the context that follows, I get a superfluous_disable_command warning. This is probably not intentional, as the purpose of swiftlint:disable all is to silence every possible warning, including superfluous_disable_command warnings.

If my guess that this is a bug is right, I'd be happy to push a fix.

Environment

  • SwiftLint 0.31.0 (Installed via Homebrew)
  • Xcode 10.1
@marcelofabri

This comment has been minimized.

Copy link
Collaborator

commented Mar 7, 2019

Is some_rule a rule that exists? There was a change recently to warn on rules that don't exist, so that could be related.

@fredpi

This comment has been minimized.

Copy link
Contributor Author

commented Mar 7, 2019

@marcelofabri It doesn't matter, the bug occurs for both existing and undefined rules.

@jpsim

This comment has been minimized.

Copy link
Collaborator

commented Apr 7, 2019

If my guess that this is a bug is right, I'd be happy to push a fix.

I'd say this is a bug, especially if I try to think of when I'd want to use swiftlint:disable all at the top of a file, which is probably because I'm prototyping something real quick and don't want to be distracted by linter warnings.

@fredpi you have my full support if you'd like to fix this 😄

@jpsim jpsim added the bug label Apr 7, 2019

marcelofabri added a commit that referenced this issue Apr 12, 2019

Merge pull request #2716 from fredpi/feature/#2670-fix-superfluous-di…
…sable

Fix "superfluous_disable_command" / "disable all" interference
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.