command line for running the format checker?

Hi all,

What’s the proper command line invocation to run our sources through to get proper LLVM formatting and other desired fix-ups?


git clang-format should do it. There are two things it doesn’t handle:

  1. It puts constructor initializer list separators (comma and colon) at the beginning of each line instead of at the end of each line.
  2. It doesn’t put return type on a separate line for declarations (but it does for definitions).

I should probably take some time and go fix those 2 issues in clang-format…

For anyone not using git, git clang-format essentially runs the script llvm/tools/clang/tools/clang-format/git-clang-format. You can run that script manually with --help to get more information about how to use it without git. And there may also be a way to integrate it into svn so you can write something like svn clang-format

Awesome, thanks Zachary!