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 · Fixed by #2716
Closed

superfluous_disable_command overrides disable all #2670

fredpi opened this issue Mar 6, 2019 · 3 comments · Fixed by #2716
Labels
bug Unexpected and reproducible misbehavior.

Comments

@fredpi
Copy link
Collaborator

fredpi 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
Copy link
Collaborator

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
Copy link
Collaborator Author

fredpi commented Mar 7, 2019

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

@jpsim
Copy link
Collaborator

jpsim 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 Unexpected and reproducible misbehavior. label Apr 7, 2019
marcelofabri added a commit that referenced this issue Apr 12, 2019
…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
Labels
bug Unexpected and reproducible misbehavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants