-
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
False positive in array_init
#3749
Comments
I spent some time looking at this today, and I could be wrong since this is my first time jumping into the codebase, but it looks like the way to fix this issue would require changing the ArrayInitRule's I couldn't see a way to make one ASTRule able to operate on more than one KindType. Maybe there's another way that I'm just missing? |
My take on this is that it cannot be fixed without knowing the type of the object at which |
Analyzer rules have been pretty stable and we could remove the "experimental" label on them. |
So, is it okay to convert the |
You could make a new analyzer rule that does what However, I wouldn’t remove the current |
That's what I also thought after reading your comment. Let me give it a try. |
Can this one be closed now that there is TypesafeArrayInitRule available, @jpsim? I mean, the bug is still valid but certainly won't be fixed. |
Yes let's close this, if someone wants a type-checked version of the rule they can use TypesafeArrayInitRule, albeit requiring the compilation database. |
New Issue Checklist
Describe the bug
A clear and concise description of what the bug is.
Complete output when running SwiftLint, including the stack trace and command used
Environment
swiftlint version
to be sure)? 0.45.0Are you using nested configurations?
If so, paste their relative paths and respective contents.
No
Which Xcode version are you using (check
xcodebuild -version
)?Xcode 13.1
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
.The text was updated successfully, but these errors were encountered: