C++ style guides
Formatting
ClangFormat: auto-formats C++ code
Git hook running clang-format. Don't use this!
Static analysis tools
Clang-Tidy: C/C++ linting tool, à la Google's cpplint.
clang-tidy -checks='*' *.cpp -- -std=c++11
Clang Static Analyzer: sets CC and CXX to use alternate compiler to do analysis
# Highest severity warnings only (i.e. memory leaks, etc)
cppcheck --enable=all *.cpp
# Everything except style-related linting
cppcheck --enable=warning,performance,portability,information,missingInclude \
--std=c++11 --library=std.cfg --verbose --quiet \
*.cpp
Overview articles: