You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
I wanted to format my c++ code for comitting and thus executed the reformat-source script on macOS from the libelektra root directory.
Describe what you expected
I expected that it will successfully reformat the sourcecode.
Describe what actually happened
First, clang-format-3.8 was missing, which i installed using homebrew "brew install clang-format". However, this provides the clang-format command, not clang-format-3.8, i simply changed the script locally for now, alternatively i could have made an alias for clang-format-3.8 to clang-format.
Then it complained that readlink does not support the -f option. The funny thing is that the man pages says it should support this option, but upon execution it tells you
readlink: illegal option -- f
usage: readlink [-n] [file ...]
I just stripped the option then it stopped complaining.
After these steps the script worked successfully and did reformat the code. Is there any way to make this work for both platforms, or would it be better to offer a slightly adjusted script for mac? Or is there another solution?
System Information
Elektra Version: master
clang-format
macOS Sierra
The text was updated successfully, but these errors were encountered:
Thanks for reporting! I thought it works nicely thus @sanssecours was the one who initiated using clang-format after all and never complained ;)
clang-format should be simply to fix by detecting it with which. (Prefer -3.8 if available, otherwise use it without postfix, maybe with version check).
The -f option is used nearly everywhere, maybe we should have an include-common (like we have configure-common now) which fixes these incompatibilities and provides common functions/variables for shellscripts?
I thought it works nicely thus @sanssecours was the one who initiated using clang-format after all and never complained ;)
As far as I can remember I never used reformat-source. I just use the ”Reformat Document” command of TextMate’s C-Bundle, which reformats the current file after you press Ctrl + ⇧ + H.
Describe what you wanted to do
I wanted to format my c++ code for comitting and thus executed the reformat-source script on macOS from the libelektra root directory.
Describe what you expected
I expected that it will successfully reformat the sourcecode.
Describe what actually happened
First, clang-format-3.8 was missing, which i installed using homebrew "brew install clang-format". However, this provides the clang-format command, not clang-format-3.8, i simply changed the script locally for now, alternatively i could have made an alias for clang-format-3.8 to clang-format.
Then it complained that readlink does not support the -f option. The funny thing is that the man pages says it should support this option, but upon execution it tells you
I just stripped the option then it stopped complaining.
After these steps the script worked successfully and did reformat the code. Is there any way to make this work for both platforms, or would it be better to offer a slightly adjusted script for mac? Or is there another solution?
System Information
The text was updated successfully, but these errors were encountered: