-
Notifications
You must be signed in to change notification settings - Fork 10
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
Wrong formatting for "install" command #54
Comments
AFAICT it was a bug already covered in #51. Try with the newest 0.18.2. |
@b-nathan Let me know if the issue is cleared for you with the newest version. |
@BlankSpruce first of all thank you very much for developing this tool and especially actively maintain it! The newest version indeed changes the behaviour and formats the code as follows: (
When I the set
When I the set
Can you explain me, why it does not fully expand, when the |
Short answer:
https://cmake.org/cmake/help/latest/command/install.html#targets [DESTINATION <dir>] # one value
[PERMISSIONS <permission>...] # multi value
[CONFIGURATIONS <config>...] # multi value
[COMPONENT <component>] # one value
[NAMELINK_COMPONENT <component>] # one value
[OPTIONAL] [EXCLUDE_FROM_ALL] # options
[NAMELINK_ONLY|NAMELINK_SKIP] # options However ridiculous $ gersemi --list-expansion favour-expansion CMakeLists.txt
install(TARGETS ${NAME} DESTINATION bin)
$ gersemi --list-expansion favour-expansion -l 20 CMakeLists.txt
install(
TARGETS
${NAME}
DESTINATION bin
)
$ gersemi --list-expansion favour-expansion -l 18 CMakeLists.txt
install(
TARGETS
${NAME}
DESTINATION
bin
) Or if you really really want to have line break you can force it with comment (empty comment is enough), gersemi --list-expansion favour-expansion CMakeLists.txt
install(
TARGETS
${NAME}
DESTINATION #
bin
COMPONENT foobar
) Longer answer:
I'm not saying this is the perfect* way to format code but I can safely claim there is some consistency and reasoning for current state of Longer longer answer: * - Nowadays I think style slightly closer to perfection is somewhere in space between
|
Thank you for the thorough explanation. It really helped to understand, why the code is formatted as it is and I can perfectly live the way it is right now. |
gersemi --version gersemi 0.17.0 lark 1.2.2 colorama (missing) Python 3.9.2 (default, Dec 1 2024, 12:12:57) [GCC 10.2.1 20210110]
This is how
gersemi
formatts theinstall
section:And this is how I think it should be formatted, according to the CMake Documenation:
What rules follows gersemi for formatting and why does it not format as expected?
This is my
.gersemirc
:The text was updated successfully, but these errors were encountered: