Skip to content
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

[fix] Test more package names converted to CamelCase in 'conan new -t' command #6821

Merged
merged 2 commits into from Apr 14, 2020

Conversation

jgsogo
Copy link
Contributor

@jgsogo jgsogo commented Apr 8, 2020

Changelog: Bugfix: Variable package_name in conan new -t <template> command contains a CamelCase version of the name of the package.
Docs: conan-io/docs#1663

@jgsogo jgsogo added this to the 1.25 milestone Apr 8, 2020
@jgsogo jgsogo self-assigned this Apr 8, 2020
@jgsogo jgsogo changed the title snake_case to CamelCase [fix] Test more package names converted to CamelCase in 'conan new -t' command Apr 8, 2020
@jgsogo jgsogo assigned czoido and unassigned jgsogo Apr 9, 2020
@SSE4
Copy link
Contributor

SSE4 commented Apr 9, 2020

what's the reason to convert package names to CamelCase? it's known to cause troubles on case-insensitive file system, and I thought we agreed to use only lower-case for package names.

@memsharded
Copy link
Member

what's the reason to convert package names to CamelCase? it's known to cause troubles on case-insensitive file system, and I thought we agreed to use only lower-case for package names.

It is just the name of the class in the conanfile.py, not the package-name. The naming of variables is confusing.

But to be honest, I don't fully got why this PR is necessary, what is fixing, as the class name is mostly irrelevant?

@jgsogo
Copy link
Contributor Author

jgsogo commented Apr 13, 2020

I was having a look at the conan new command as another good candidate to take advantage of the templates approach, reading the docs, having a look to the sources,... and I found this package_name name variable (really bad name, yes, but documented 🤷 ).

The docs say it is converting the actual package name to camel case (to be used for the classname), but with the existing regex it was not working for some package names:

  • "my-package" -> "Mypackage"
  • "my.package" -> "Mypackage"
  • "my+package" -> "Mypackage"

Now it is returning "MyPackage" for all of them

@memsharded
Copy link
Member

Yep, really bad, bad name...

@czoido czoido merged commit 2c73083 into conan-io:develop Apr 14, 2020
@jgsogo jgsogo deleted the fix/new-template branch April 14, 2020 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants