Skip to content

Update enum generation key formatting#83

Merged
yucombinator merged 2 commits intoslackhq:masterfrom
ZachJBurns:zb_update_enum_generation
Mar 3, 2025
Merged

Update enum generation key formatting#83
yucombinator merged 2 commits intoslackhq:masterfrom
ZachJBurns:zb_update_enum_generation

Conversation

@ZachJBurns
Copy link
Contributor

Updates enum key generation to convert : and . to _.

@salesforce-cla
Copy link

Thanks for the contribution! Before we can merge this, we need @ZachJBurns to sign the Salesforce Inc. Contributor License Agreement.

$members = \HH\Lib\Vec\map(
$enum,
$member ==> $factory->codegenEnumMember(Str\uppercase($member))
$member ==> $factory->codegenEnumMember(Str\uppercase(Str\replace_every($member, dict[':' => '_', '.' => '_'])))

Choose a reason for hiding this comment

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

it's a bit stylistic, but what do you think about:

$member ==> Str\replace_every($member, dict[':' => '_', '.' => '_'])
	|> Str\uppercase($$)
	|> $factory->codegenEnumMember($$)->setValue($$, HackBuilderValues::export()),

just to remove some of the nesting and get a bit more clarity?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks a lot better now! And got the CLA test to run again 😄

@yucombinator yucombinator merged commit 48def08 into slackhq:master Mar 3, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants