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 triggers for non existent rule names when swiftlint:disable all is in effect #4788

Closed
mildm8nnered opened this issue Feb 28, 2023 · 1 comment · Fixed by #4791
Labels
bug Unexpected and reproducible misbehavior.

Comments

@mildm8nnered
Copy link
Collaborator

New Issue Checklist

Describe the bug

A clear and concise description of what the bug is.

// swiftlint:disable all
// swiftlint:disable non_existent_rule_name

No rules should be enabled, but superfluous_disable will still fire with Superfluous Disable Command Violation: 'non_existent_rule_name' is not a valid SwiftLint rule; remove it from the disable command (superfluous_disable_command)

Complete output when running SwiftLint, including the stack trace and command used
% swiftlint Foo.swift 
Linting Swift files at paths Foo.swift
Linting 'Foo.swift' (1/1)
/tmp/Foo.swift:2:44: warning: Superfluous Disable Command Violation: 'non_existent_rule_name' is not a valid SwiftLint rule. Please remove it from the disable command. (superfluous_disable_command)
Done linting! Found 1 violation, 0 serious in 1 file.

Environment

  • SwiftLint version (run swiftlint version to be sure)? 0.50.3
  • Installation method used (Homebrew, CocoaPods, building from source, etc)? Homebrew
  • Paste your configuration file:

none

no

  • Which Xcode version are you using (check xcodebuild -version)?

Xcode 14.2
Build version 14C18

  • Do you have a sample that shows the issue? Run echo "[string here]" | swiftlint lint --no-cache --use-stdin --enable-all-rules
    to quickly test if your example is really demonstrating the issue. If your example is more
    complex, you can use swiftlint lint --path [file here] --no-cache --enable-all-rules.
// swiftlint:disable all
// swiftlint:disable non_existent_rule_name
@mildm8nnered
Copy link
Collaborator Author

// swiftlint:disable all
// swiftlint:disable superfluous_disable_command
// swiftlint:disable non_existent_rule_name

Also triggers the violation

@SimplyDanny SimplyDanny added the bug Unexpected and reproducible misbehavior. label Mar 1, 2023
mildm8nnered added a commit to mildm8nnered/SwiftLint that referenced this issue Mar 1, 2023
…uld not fire, even for invalid rule identifiers
mildm8nnered added a commit to mildm8nnered/SwiftLint that referenced this issue Mar 4, 2023
…uld not fire, even for invalid rule identifiers
mildm8nnered added a commit to mildm8nnered/SwiftLint that referenced this issue Mar 5, 2023
…uld not fire, even for invalid rule identifiers
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
2 participants