...
The configuration file that details specifics for Clang-Format are in .clang-format in the root directory of the repository. It was generated using clang-format -style=google -dump-config > .clang-format
and aforementioned changes were made. When clang-format is run, it looks for this file in the current working directory.
Usage (TL;DR)
- Make sure you have the latest version of
- Run
make check
to see if your code passes the linting/formatting checks. It will tell you what step it fails on. - If it fails the formatting step (which is clang-format), run
make format
to apply formatting changes. This will move things around to make your code prettier. Go back to step 1 and runmake check
again. - If it fails the linting step (which is clang-tidy), read the error(s) it's spitting out and try to fix them. These may be more varied since linting is static analysis for bugs, naming checks, and more. Go back to step 1 and run
make check
again. - Once
make check
passes, runmake leader
(or equivalent to build code for the desired target) and ensure that there are no compilation errors. Sincemake format
andmake tidy
change your code pretty heavily, there is a good chance that they make your code fail compilation. Fix the errors and do steps 1-5 again.