yade-dev team mailing list archive
Mailing list archive
Re: Removing trailing white space, yay or nay?
It’s a great idea. And I’m surprised how personal it is for me :) Code readability is top priority for me. I’m sure we will find the clang-format settings which suits us.
Automatic checks if the recently touched files (e.g files from the current MR) were reformatted will definitely help us. At first this will add some unreadable diffs. But later it will be a refreshing breeze :)
-- Janek Kozicki
On 17 Oct 2019, 18:59 +0200, Anton Gladky <gladky.anton@xxxxxxxxx>, wrote:
> I propose to use the clang-format , 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 , 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.
>  https://clang.llvm.org/docs/ClangFormat.html
>  https://gitlab.com/yade-dev/trunk/merge_requests/298
> Mailing list: https://launchpad.net/~yade-dev
> Post to : yade-dev@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~yade-dev
> More help : https://help.launchpad.net/ListHelp