by luoshi006
代码风格
提交策略
注释
-
TODO
'TODO' is for useful features, optimizations or refactorings that might be worth doing in the future.
-
FIXME
'FIXME' is for things which are definitely broken, but where you want to not worry about it for the moment.
-
XXX
'XXX' is for things that require more thought and that are arguably broken.
-
aka
Also Known As
-
WIP
WIP — work in progress
Tools
A Style
> sudo apt install astyle
# sigle file
astyle one.cpp
# folder
astyle --recursive ./*.cpp *.h *.cc *.hpp *.c
.astylerc
# For full docs:
# http://astyle.sourceforge.net/astyle.html
#
--style=1tbs
--suffix=none
--recursive
#缩进4个空格
--indent=spaces=4
--max-code-length=128
--pad-header
--unpad-paren
--suffix=none
--align-pointer=name
--align-reference=name
--lineend=linux
#TAB转换为空格
--convert-tabs
--verbose
#移除括号两端多余空格
--unpad-paren
--indent-switches
--indent-col1-comments
--mode=c
# disable the format
# // *INDENT-OFF*
# #define FOO_DECLARE_int32_(name) \
# FOO_API_ extern ::Int32 FOO_FLAG(name)
# // *INDENT-ON*