-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[program-gen] Normalize the declaration name of generated resource components #13606
Conversation
Changelog[uncommitted] (2023-07-27)Bug Fixes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks reasonable, although part of me wonders if we should be making PCL strict about component folder names instead?
Like if we said a component folder had to be a PCL identifier ([A-Za-z][A-Za-z0-9_]*) then it would be up on the converters to normalize names in a way that makes sense to them.
Is there a good reason to put this automapping in PCL binder rather than PCL writers?
Right now, all the language converters use the same logic in the The only benefit about making PCL more strict about folder names is simplifying the logic inside |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reasonable. I'll ok this for now, feels like something we might revisit around names in our intermediate formats in the future though.
bors merge |
Build succeeded! The publicly hosted instance of bors-ng is deprecated and will go away soon. If you want to self-host your own instance, instructions are here. If you want to switch to GitHub's built-in merge queue, visit their help page. |
This PR adds a new function
DeclarationName()
to PCL components which is then used as the name of the component inside of the code, distinguishing it from the file name where it lives. The function returns a valid and idiomatic name to be used and references in the generated code for all of the language generators.For example if you have a component of which its source code files live
./some-component
then the declaration name for that component would beSomeComponent
etc.Fixes #13151
Checklist
make tidy
to update any new dependenciesmake lint
to verify my code passes the lint checkgofumpt
make changelog
and committed thechangelog/pending/<file>
documenting my change