yade-dev team mailing list archive
-
yade-dev team
-
Mailing list archive
-
Message #14875
Re: Removing trailing white space, yay or nay?
Hi,
I propose to use the clang-format [1], which automatically formats
the code according to the pre-defined rules. It has a nice support
by most of IDEs and can also be used through command line.
There are some pre-defined styles (LLVM, Google, Chromium, Mozilla, WebKit),
and i think we just need to choose. Fine-tuning is also possible, but
it is not necessary.
Running this tool recursively all over the code is possible, but can produce
a large, not reviewable diff. But formatting the files, touched during
development process can step-by-step fix most parts of the code and be
consistent in the future.
I have prepared a WIP-merge request [2], where the .clang-format file is added
and the Scene.cpp was reformatted using this tool. So you can check,
whether it will work for us. Style format can be changed, but it looks like
LLVM-style will produce the minimal changes.
Pipelines can also check, whether the committer formatted the code
with clang-format. At the end we will forget the formatting problem in Yade.
Generally, I have a good experience with this tool and I hope it can
work for this project as well. Comments are welcome.
[1] https://clang.llvm.org/docs/ClangFormat.html
[2] https://gitlab.com/yade-dev/trunk/merge_requests/298
Regards
Anton
Follow ups
References