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
[SR-8257] Provide package init custom naming strategy #4770
Labels
Comments
Adding an option to specify the name using `--packageName` sounds good to me! |
@swift-ci create |
Comment by Jhonny Bill Mena (JIRA) Seems interesting. Can I work at this? |
go for it. as far as the name of the option, I think --name would be sufficient. Have fun!
|
Yep, --name sounds good. |
Comment by Jhonny Bill Mena (JIRA) |
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Additional Detail from JIRA
md5: 8a8537b674120cb874c1adfdf50ef94c
Issue Description:
swift package init --help
OPTIONS:
--type empty|library|executable|system-module
Provide `package init ` option to allow custom name:
--packageName provide custom package name
Alternatively, we would provide a naming strategy based on the folder name. This is more involved an perhaps not needed if a custom name could be provided.
Provide `package init ` option to allow specifing the casing of the package name. Currently this is locked to `self.pkgname = dirname`. All my folder are snake case but all my package names are PascalCased.
--nameStrategy default|camelCase|PascalCase|snake_case
Since it seems to be convention to name packaes with Pascal case then we probably just need
--nameStrategy default|PascalCase
where default is the current verbarim of the name of the folder
1) We would guess if the source name is snake_case, camelCase or PascalCase
snake_case: no uppercase chars, _ or -
camelCase: first char lowercaase, some uppercase
PascalCase: first char uppercase some uppercase and lowercase letter.
2) If the name has any spaces, go back to default and print a message.
If we cant naively figure out on of the three cases above then just give up and go back to default.
Sample code:
https://github.com/apple/swift/blob/master/stdlib/public/SDK/Foundation/JSONEncoder.swift
The text was updated successfully, but these errors were encountered: