You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updated SwiftLint to the latest version - I honestly didn't and I'm on v0.39.2 but I believe this still happens in latest version (can't upgrade to test right now 😿 ) - feel free to close if you're able to test it and it doesn't happen in the latest release 🙏
Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint lint
Environment
SwiftLint version (run swiftlint version to be sure)? 0.39.2
Installation method used (Homebrew, CocoaPods, building from source, etc)? Homebrew
Paste your configuration file:
# The only relevant part is:opt_in_rules:
- toggle_bool
Are you using nested configurations?
If so, paste their relative paths and respective contents. 🤔 don't think so
Which Xcode version are you using (check xcodebuild -version)? Xcode 12.0
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.
There is a \ before the ! to escape the ! because apparently that causes issues in the script. But the example in Swift would be:
// This triggers a violation:
something = !something.isEmpty ? executeA():executeB()
And it shouldn't. In my project the line was much more complex but I could simplify and reproduce it using that statement. In my project I just switched the ternary to e.g. something.isEmpty ? executeB() : executeA() but not sure if that will be possible in all cases 🤔
The text was updated successfully, but these errors were encountered:
New Issue Checklist
Describe the bug
toggle_bool
false positive.Complete output when running SwiftLint, including the stack trace and command used
Environment
swiftlint version
to be sure)? 0.39.2If so, paste their relative paths and respective contents. 🤔 don't think so
xcodebuild -version
)? Xcode 12.0echo "[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
.This shows my issue:
There is a
\
before the!
to escape the!
because apparently that causes issues in the script. But the example in Swift would be:And it shouldn't. In my project the line was much more complex but I could simplify and reproduce it using that statement. In my project I just switched the ternary to e.g.
something.isEmpty ? executeB() : executeA()
but not sure if that will be possible in all cases 🤔The text was updated successfully, but these errors were encountered: