Scripts: add optional indentClosingBrace for function declarations#2699
Scripts: add optional indentClosingBrace for function declarations#2699yixun-chen wants to merge 1 commit intoKhronosGroup:mainfrom
Conversation
|
We'll discuss on the next working group teleconference - personally, I like the change. I think we would want to apply it consistently to the generated headers and to the asciidoc fragments (the docgenerator) that get included in the spec/refpages, and that's probably best accomplished by making the default True rather than littering genvk.py with a bunch of these settings. VulkanSC might have a different opinion as they have some domain-specific constraints on their headers due to MISRA requirements. Perhaps @dgkoch or @markbellamy could comment on that. |
|
Thank you for the positive feedback! I completely agree that consistency across the generated headers and Asciidoc fragments is key. Making this the default behavior to keep genvk.py clean makes a lot of sense. Since I'm still getting familiar with the generator tools (especially the docgenerator part), I’d appreciate some guidance once the working group reaches a decision. I'm happy to update the PR to implement this more broadly as suggested. Looking forward to the outcome of the teleconference! |
|
It's been a bit since the VKSC WG has looked at MISRA requirements, but we don't think there are any stylistic requirements, so we don't object to it from that perspective. That said, this seems to be purely a code-formatting stylistic option, and it seems like a slippery slope to start going down. Next we'll be arguing over spaces vs tabs or 8 space tabs vs 4 space tabs :-) |
|
There are no tabs coming out of the generator scripts, nor in the spec repository aside from the Makefiles and imported upstream files. I learned that lesson about 30 years ago and it is a hill I would die on. But I believe the sense of the teleconference was to go ahead with this once we sort it out to apply everywhere. |




Description
I've added a new configuration option,
indentClosingBrace, to the code generator. This is a preliminary step to potentially improve the structure and readability of function declarations, especially for complex API signatures.The Goal of This Change
);difficult to spot. Moving it to a new line might make the signature block clearer for documentation.Implementation Details
The toggle is added to the generator script and is currently disabled by default to ensure no immediate changes to the current headers.
scripts/genvk.pyConsiderations & Impact
False, the generated output remains exactly the same. This ensures no existing workflows are affected by this PR.Please let me know if this approach makes sense, or if you have any concerns about the implementation. Thanks!