-
Notifications
You must be signed in to change notification settings - Fork 38
Use the new "pretty" swiftIdentifier filter #74
Conversation
Podfile
Outdated
@@ -3,7 +3,7 @@ use_frameworks! | |||
|
|||
def common_pods | |||
pod 'Stencil', :inhibit_warnings => true | |||
pod 'StencilSwiftKit', :git => 'https://github.com/SwiftGen/StencilSwiftKit' | |||
pod 'StencilSwiftKit', :git => 'https://github.com/SwiftGen/StencilSwiftKit', :branch => 'feature/pretty-swiftidentifier' |
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.
@@ -109,7 +109,7 @@ enum StoryboardSegue { | |||
case CustomBack | |||
case Embed | |||
case NonCustom | |||
case Show_NavCtrl = "Show-NavCtrl" | |||
case ShowNavCtrl = "Show-NavCtrl" |
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 mean that the next release is gonna be breaking?
I'm OK with that — the change is good here — but we'll have to wonder if that should mean bumping SwiftGen to major for that too…
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.
TBH, these are all swift 2 changes, which we don't support. I wouldn't bump the version for it.
{{sp}} {% endfor %} | ||
{% endmacro %} | ||
{% if palettes.count > 1 %} | ||
{% for palette in palettes %} | ||
enum {{palette.name|swiftIdentifier|titlecase|snakeToCamelCase|escapeReservedKeywords}} { | ||
enum {{palette.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} { |
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 wonder if escaping reserved Swift keywords shouldn't also be a role for swiftIdentifier
, as that filter is supposed to make any string into a valid Swift identifier, and private
isn't valid for an identifier, so…
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.
That would be more difficult, because stuff can happen with the string between swiftIdentifier
and escapeReservedKeywords
. For example, all swift 3 identifiers that start lowercased will be:
|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords
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.
Which is also a reason why I don't like swiftIdentifier
to uppercase the first letter 😉
e.g. iOSModel
--[swiftIdentifier]--> IOSModel
--[lowerFirstWord]--> iosModel
😉
But that's a different debate I guess ^^
b656201
to
e891a93
Compare
e891a93
to
35c42f5
Compare
Fixes SwiftGen/SwiftGen#289
Applies new filter from SwiftGen/StencilSwiftKit#61