-
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 for the collection_alignment rule when "…" is used #4837
Comments
The system does a lot of mapping between ellipsis and three dots. For example, on MacOS menu items defined with three dots, and those defined with the ellipsis will appear identical. This treatment can vary subtly between OS's - we had to update a unit test for Ventura on my product for a case where we were expecting to see three dots, but instead now got ellipsis, or possibly vice versa. "Unicode recognizes a series of three period characters (U+002E) as compatibility equivalent (though not canonical) to the horizontal ellipsis character". |
I think this could be tricky to fix in SwiftLint itself, because we're getting the locations via In fact, The best workaround for you is probably just to use three dots instead - in almost all contexts, where these should be ellipsis, the OS will automatically render them correctly for you. |
Thank you for the insights, @mildm8nnered! However, this issue is not specific to the ellipsis. We can observe the same for emoji. So I think this is a general issue with how SwiftLint interprets text. It's not always right to go down to the encoding level. Here, it's about what's visible to the user. In the case of the ellipsis, it's 1 character ( |
New Issue Checklist
Describe the bug
A false positive warning occurs for the collection_alignment Rule when using "…" in the first line.
Adding 2 more spaces to the second line will resolve the issue, and seems as if "…" is considered 3 characters.
Example:
A clear and concise description of what the bug is.
Complete output when running SwiftLint, including the stack trace and command used
Error:
Rules:
Environment
Swiftlint version: 0.50.3
The text was updated successfully, but these errors were encountered: