代码规范笔记

by luoshi006

代码风格

提交策略

注释

  1. TODO

    'TODO' is for useful features, optimizations or 
    	refactorings that might be worth doing in the future.
    
  2. FIXME

    'FIXME' is for things which are definitely broken, 
    	but where you want to not worry about it for the moment.
    
  3. XXX

    'XXX' is for things that require more thought and 
    	that are arguably broken.
    
  4. aka

    Also Known As
    
  5. 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*
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值