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

improvement: add casing version and allow for "preserved" casing words #3777

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

armandobelardo
Copy link
Contributor

No description provided.

smartCasing ||
casingVersion === generatorsYml.CasingVersion.V0 ||
casingVersion === generatorsYml.CasingVersion.V1
) {
Copy link
Member

Choose a reason for hiding this comment

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

i would have thought that v0 would not default to smart casing?

Some context on the PR about what is v0 and what is v1 would be helpful

}: {
generationLanguage: generatorsYml.GenerationLanguage | undefined;
keywords: string[] | undefined;
smartCasing: boolean;
casingVersion: generatorsYml.CasingVersion | undefined;
Copy link
Member

Choose a reason for hiding this comment

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

do you think we can delete smartCasing altogether and just rely on casingVersion now here?

i would have expected the code to read something like:

switch (version) {
  case "v0": 
    // do a vanilla case
  case "v1": 
    // handle initialisms and numbers
  default: 
    assertNever(version)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So you want to have a yaml migration to move smartCasing to v0?

Copy link
Member

Choose a reason for hiding this comment

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

I think internally in the codebase we can have casingVersion (in ir-generator for example), but externally we can listen to version first and then fall back to smart-casing -> v1

Copy link
Member

Choose a reason for hiding this comment

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

so no yaml migration needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants