-
Notifications
You must be signed in to change notification settings - Fork 11
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
Improving clang formatting #203
Conversation
… formatting of single files
…space in .clang-format
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.
As I commented to @lobis it would be interesting that our Cmake
system forces that reformat-clang.sh
is executed at the beginning of each make
execution. So that any user that launches code compilation keeps a good formatting.
It could be nice but maybe it would give problems, also it takes a fair amount of time to execute the clang-format. It would be annoying for users such as me that have this done automatically on file save. I think it may be better a step on the pipeline that gives error if the source files have not been clang-formatted? (calculating the diff etc.). |
Perhaps would be better to use a pre-commit hook https://stackoverflow.com/questions/55965712/how-do-i-add-clang-formatting-to-pre-commit-hook |
It is not possible to implement it in the repo, at most you can have a file in the repo and direct users to copy this file into their |
Can this be done at the build or in the cmake? Or this is an overkill? Also note that you need |
I have added a Please, check again. |
…into clang-script
Script
reformat-clang
has been improved:readlink
to make the script independent from the path where is launched*.h
,*.cxx
,*.cc
and*.C
Added
githook
in thecmake
, so theclang-format
is performed whengit commit
is issuedgithook
is created whencmake
is issued and if there is nopre-commit
present.clang-format
is present in the system, otherwise is skipped.githook
features.