Incredible coincidence, I used clang-format today for the first time and was looking for such a tool. The one I found had no preview so I just tried a few built-in styles and picked one that was close to my style.
I'm writing a lot of code recently and gently trying to get my colleagues (and myself) to do "best practices" like consistent code formatting, not too long lines, thinking about readability, but also using modern C++11/14 features for cleaner code. We're physicists and mostly not professional programmers so we're a bit behind in some things.
I recently installed YouCompleteMe with vim which really is a game changer - the code completion makes it more pleasant to write in C++(11) than in python (which are the two languages our framework supports), and the error/warning highlighting catches most bugs before compiling. Long story short, for YCM I installed clang, and it comes with a bunch of tools like clang-format. There seems to be a static analyzer which I want to check out, and a tool that finds opportunities to use clearer modern C++11 constructs, pretty nice.
I'm writing a lot of code recently and gently trying to get my colleagues (and myself) to do "best practices" like consistent code formatting, not too long lines, thinking about readability, but also using modern C++11/14 features for cleaner code. We're physicists and mostly not professional programmers so we're a bit behind in some things.
I recently installed YouCompleteMe with vim which really is a game changer - the code completion makes it more pleasant to write in C++(11) than in python (which are the two languages our framework supports), and the error/warning highlighting catches most bugs before compiling. Long story short, for YCM I installed clang, and it comes with a bunch of tools like clang-format. There seems to be a static analyzer which I want to check out, and a tool that finds opportunities to use clearer modern C++11 constructs, pretty nice.