clang-format
1. 生成google風(fēng)格配置:.clang-format
clang-format-4.0 -style=google -dump-config > .clang-format
2. 修改.clang-format行字符數(shù)120桑包; ColumnLimit :120
3. 格式化代碼:
clang-format-4.0 -style=.clang-format -i node/axagent/camxchinodeaxagent.h
clang-format-4.0 -style=file -i node/axagent/camxchinodeaxagent.cpp
cpplint
https://zhuanlan.zhihu.com/p/79913216
方式一:
cpplint.py下載地址:
https://github.com/cpplint/cpplint
cpplint掃描代碼:
python cpplint.py --linelength=120 node/axagent/camxchinodeaxagent.cpp
方式二:
pip install cpplint.py
cpplint --linelength=120 xxx.cpp