-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
empty_enum_arguments false positive with static func #3294
Comments
This is a regression from 0.39.2, which did not report any violations with the provided repro steps. |
Introduced in #3122 |
I'll take a look. |
I tried fixing it, however I did not find any solution achievable through a simple regex change. Attempt 1: Require to be preceded by Regex: However, this fails when there is more than one case per line: Attempt 2: Require at least 1 Regex: But this fails on an earlier example However, the only compiling code which contains enum Foo {
case bar(Void)
}
let foo: Foo
switch foo {
case .bar(): break
} Because in case of a Void type, you are allowed write either Any non-Void type will fail to compile with the error Considering I don't think I've ever seen an enum-case with a Otherwise, I am not sure how to determine that |
Only the post-typechecked AST, which Analyzer Rules operate on, but not standard lint rules. |
This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions! |
New Issue Checklist
Describe the bug
With this code:
And this config:
.empty()
is falsely marked as something where()
can be removed. But those are required to build:Complete output when running SwiftLint, including the stack trace and command used
Environment
swiftlint version
to be sure)? 0.40.0related to #3103 and #3122
The text was updated successfully, but these errors were encountered: