Skip to content

Casing namespace #145

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

Merged
merged 13 commits into from
May 4, 2025
Merged

Casing namespace #145

merged 13 commits into from
May 4, 2025

Conversation

nojaf
Copy link
Contributor

@nojaf nojaf commented Nov 29, 2024

Fixes #144

I have very little idea what I'm doing here.
I don't know any Rust and just tried the hint of @tsnobip in #144 (comment)

@@ -312,7 +333,7 @@ impl Config {
namespace if namespace.is_case(Case::UpperFlat) => {
packages::Namespace::Namespace(namespace.to_string())
}
namespace => packages::Namespace::Namespace(namespace.to_string().to_case(Case::Pascal)),
namespace => packages::Namespace::Namespace(namespace_from_package_name(namespace)),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is another use of to_case(Case::Pascal) on line 348, but actually I think you can simplify this match quite a lot and always process namespace whatever the initial case with this new function.

@jfrolich
Copy link
Collaborator

This is amazing, can we merge this?

@nojaf
Copy link
Contributor Author

nojaf commented Mar 12, 2025

Can't fix CI this week. Feel free to tweak this if you have the bandwidth.

@nojaf nojaf force-pushed the casing-namespace branch from e8b261d to c3c3372 Compare May 3, 2025 10:10
@nojaf nojaf requested a review from jfrolich May 3, 2025 12:52
@nojaf nojaf merged commit 1a9e894 into rescript-lang:master May 4, 2025
1 check passed
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.

Casing in namespace is not respected
3 participants