Open
Description
Semi-related to #1426, it would be great if UniFFI could generate Swift function/variable/argument/type names that conform to the “Follow case conventions” point in the Swift API Design Guidelines:
Acronyms and initialisms that commonly appear as all upper case in American English should be uniformly up- or down-cased according to case conventions.
A couple of examples:
Rust | Swift (current) | Swift (desirable) |
---|---|---|
avatar_url |
avatarUrl |
avatarURL |
raw_json_string |
rawJsonString |
rawJSONString |
Some obvious thoughts that came out of an initial conversation:
- This should be opt-in to avoid breaking backwards compatibility.
- The set of acronyms/initialisms should probably be defined by each project in their
uniffi.toml
as whilst some conversions likeURL
andJSON
aren't debatable, other such asID
may raise discussion as to whether or not they count (and this clearly isn't UniFFI's problem to deal with).- This could also make incremental adoption easy as a project could migrate acronym by acronym.