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
When running SwiftLint autocorrect, the operator_usage_whitespace rule will fix equal sign column alignment for some right-hand side operands, but not some literals. For example:
let color = UIColor.black // triggers violation
let six = 6 // triggers violation
let foo = "foo" // does not trigger violation, but should
let array = [3.14] // does not trigger violation, but should
So, after auto-correct, I'm left with:
let color = UIColor.black
let six = 6
let foo = "foo"
let array = [3.14]
Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint lint
for properly triggered violations:
warning: Operator Usage Whitespace Violation: Operators should be surrounded by a single whitespace when they are being used. (operator_usage_whitespace)
for the String/Array literals listed above, no output is given (i.e. linting succeeds)
Environment
SwiftLint version (run swiftlint version to be sure)? 0.39.2
Installation method used (Homebrew, CocoaPods, building from source, etc)? CocoaPods
Paste your configuration file:
opt_in_rules:
...
- operator_usage_whitespace
...
Are you using nested configurations? No
If so, paste their relative paths and respective contents.
Which Xcode version are you using (check xcodebuild -version)? 11.3.1 (11C505)
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.
letfoo="foo" // does not trigger violation, but should
letarray=[3.14] // does not trigger violation, but should
The text was updated successfully, but these errors were encountered:
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!
stalebot
added
the
wontfix
Issues that became stale and were auto-closed by a bot.
label
Nov 8, 2020
New Issue Checklist
Describe the bug
When running SwiftLint autocorrect, the operator_usage_whitespace rule will fix equal sign column alignment for some right-hand side operands, but not some literals. For example:
So, after auto-correct, I'm left with:
Complete output when running SwiftLint, including the stack trace and command used
for properly triggered violations:
for the String/Array literals listed above, no output is given (i.e. linting succeeds)
Environment
swiftlint version
to be sure)? 0.39.2If so, paste their relative paths and respective contents.
xcodebuild -version
)? 11.3.1 (11C505)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: