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

False positive for explicit_type_interface on switch-case-let #3615

Closed
2 tasks done
J-Mendes opened this issue Apr 28, 2021 · 6 comments
Closed
2 tasks done

False positive for explicit_type_interface on switch-case-let #3615

J-Mendes opened this issue Apr 28, 2021 · 6 comments
Labels
bug Unexpected and reproducible misbehavior.

Comments

@J-Mendes
Copy link

J-Mendes commented Apr 28, 2021

New Issue Checklist

Describe the bug

This start to happen after I updated to Xcode 12.5. Basically, all the switch statements that have a let inside the case clause are triggering this rule.

Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint lint

Explicit Type Interface Violation: Properties should have a type interface (explicit_type_interface)

Environment

  • SwiftLint version 0.43.1
  • Installation method used: Homebrew
  • Paste your configuration file:
opt_in_rules:
  - anyobject_protocol
  - closure_end_indentation
  - closure_spacing
  - explicit_init
  - explicit_self
  - implicit_return
  - joined_default_parameter
  - literal_expression_end_indentation
  - modifier_order
  - number_separator
  - operator_usage_whitespace
  - optional_enum_case_matching
  - prefer_self_type_over_type_of_self
  - prefer_zero_over_explicit_init
  - redundant_nil_coalescing
  - strong_iboutlet
  - test_case_accessibility
  - toggle_bool
  - unneeded_parentheses_in_closure_argument
  - unused_import
  - vertical_whitespace_closing_braces
  - vertical_whitespace_opening_braces

implicit_return:
  included: [closure]
vertical_whitespace:
  max_empty_lines: 2
  • Which Xcode version are you using? Xcode 12.5 Build version 12E262
  • Do you have a sample that shows the issue?
switch result {
        // This triggers a violation
        case .success(let response):
                ...
        // This triggers a violation
        case .failure(let error):
                ...
}
@marcelofabri
Copy link
Collaborator

I couldn't repro this on Xcode 12.4, so maybe something changed in the SourceKit response in Swift 5.4. I'm downloading Xcode 12.5 and will check later.

@marcelofabri
Copy link
Collaborator

OK, I was able to repro this with Swift 5.4 and it's indeed because the SourceKit structure has changed.

@marcelofabri marcelofabri added the bug Unexpected and reproducible misbehavior. label Apr 29, 2021
@BISARMA
Copy link

BISARMA commented May 26, 2021

Is this fix included in the next release?

@ppamorim
Copy link

@marcelofabri I am getting the same issue with issue 5.4. :(

@BrunoCerberus
Copy link

i'm having the same problem T.T

@daniellangh
Copy link

Same issue here, is there an ETA for the next release? Thanks.

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

No branches or pull requests

6 participants