- Read Google’s C++ Style Guide (particularly for non-formatting style reference)
- Run clang-format with
-style=file (which uses our provided .clang-format)
$ cd kovri/ && clang-format -i -style=file src/path/to/my/file
- Run cpplint (which uses our provided CPPLINT.cfg) to catch any issues that were missed by clang-format
$ cd kovri/ && cpplint src/path/to/my/file && [edit file manually to apply fixes]
- Vim integration
- Emacs integration
Here’s what’s currently not caught by clang-format and differs from Google’s proposed C++ style
- Avoid prepended mixed-case
k and MACRO_TYPE for all constants
- Use Doxygen three-slash
/// C++ comments when documenting for Doxygen
- Try to document all your work for Doxygen as you progress
- If anonymity is a concern, try to blend in with a present contributor’s style
for component dependency, physical insulation, and include checks.
- cppcheck for static analysis
(complementary to Coverity).
- lizard for code complexity checks.