-
Notifications
You must be signed in to change notification settings - Fork 739
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
Swiftlint 0.27 and enabled some extra rules #476
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that rule force #xxLiterals
or does it forbid it? I never remember
It enforces it. Might sound weird for a project like swiftgen, and it's only really for our tests. But I personally don't think they're too bad? It's easier for visual checks. |
Do we actually have object literals in the SwiftGen codebase anyway? We don't have UIColors or UIImage or any other UI type in SwiftGen survey code proper, it being a CLI tool, right? |
It's only in the color parsing tests. |
939ec83
to
2bbee0c
Compare
13892da
to
9da866f
Compare
#colorLiteral(red: 0, green: 0, blue: 0, alpha: 0): 0x00000000, | ||
#colorLiteral(red: 1, green: 1, blue: 1, alpha: 1): 0xFFFFFFFF, | ||
#colorLiteral(red: 0.973, green: 0.973, blue: 0.973, alpha: 1): 0xF8F8F8FF, | ||
#colorLiteral(red: 0.969, green: 0.969, blue: 0.969, alpha: 1): 0xF7F7F7FF |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually winder in that case if using NSColor
wouldn't stillbe better.
Because what we actually want to test there is that for a given color with those given RGBA component values, the hex representation matches.
Having those colors show up as little swatches/colored squares in the IDE doesn't help check at first sight if 0.973 matches 0xF8/0xFF, or that red, green and blue has the same value. While with their whole NSColor(…)
textual representation IDE, it might help better…
Except if you click on the little color swatches in Xcode and in the Color Palette displayed, you have a palette displaying the Hex representation… maybe… that's debatable ^^
9da866f
to
488dfb1
Compare
The only potentially contentious one might be
object_literal
.