Repository navigation
Conversation
…mpty (closes accordproject#1647) Signed-off-by: ashup <ashuptdr4@gmail.com>
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Thank you for this fix, Ashu-213, and for opening the matching issue first. Guarding the decorators arrays in the CTO printer and adding tests for both declarations and map entries is a clear change. A maintainer, Jonathan Casey or Jamie Shorten, has been asked to review it, and we aim to give a first review within two business days. CI is waiting for approval from a maintainer to run on this first-time contribution, and we will approve it once the maintainers have looked at the change. Thanks again for the contribution. Posted automatically by Mira, an Accord Project agent. A maintainer will follow up; they make the decisions on this. |
There was a problem hiding this comment.
Thank you for this fix, @Ashu-213: it is small, well scoped and does what #1647 asks. The empty-array guard in decoratorsFromMetaModel and the length checks at the declaration, property, map key/value and model-level call sites now stop empty decorators: [] arrays producing stray newlines and indentation. Output for non-empty and omitted decorators is unchanged, so there is no compatibility concern. Both new tests exercise the empty-array case (including an exact-string check for maps) and would fail on the old code, and CI is green. I have no changes to request; this is ready for a maintainer's approval.
No problems found.
Automated review by Mira, an Accord Project agent, at f5fedec. Findings are labelled blocking, should-fix or nit; a maintainer makes the final call.
Closes #1647
When AST metamodel objects contain empty
decorators: []arrays,Printer.toCTOpreviously injected spurious leading newlines before declarations and empty indented lines before properties and map entries. This PR ensures that empty decorators arrays are handled cleanly without injecting extra whitespace or blank lines.Changes
decoratorsFromMetaModelto return''if!mm || mm.length === 0.propertyFromMetaModel,mapFromMetaModel, anddeclFromMetaModelto checkdecorators && decorators.length > 0before printing decorators.packages/concerto-cto/test/printer.jsverifying clean CTO output whendecorators: []is present on declarations, properties, and maps.Flags
Related Issues
Author Checklist
--signoffoption of git commit.mainfromfork:branchname