C++ Code Style Checker
1. Cpplint
We can integrate the open source cpplint from Google into our project to check the C++ code style. Please refer to cpplint-integration repo
2. Cppcheck
开源工具,静态代码检查: 数组越界;缺少copy constructor;非explicit constructor等
apt-get install cppcheck cppcheck --enable=all *.cpp *.h *.hpp
3. Artistic Style
开源工具,自动格式化代码format,超省人工!
apt-get install astyle astyle –options=option_file *.cpp *.h *.hpp
一个可用的option_file(具体使用点此查询):
效果:
==>