跳至主要內容

编码规范

naijoug小于 1 分钟

reference

Python

$ pip install pylint # 安装 pylint
$ pylint --generate-rcfile > .pylintrc # 生成 .pylintrc 文件
TypePublicInternal
Moduleslower_with_under_lower_with_under
Packageslower_with_under
ClassesCapWords_CapWords
ExceptionsCapWords
Functionslower_with_under()_lower_with_under()
Global/Class ConstantsCAPS_WITH_UNDER_CAPS_WITH_UNDER
Global/Class Variableslower_with_under_lower_with_under
Instance Variableslower_with_under_lower_with_under (protected) or __lower_with_under(private)
Method Nameslower_with_under()_lower_with_under() (protected) or __lower_with_under(private)
Function/Method Parameterslower_with_under
Local Variableslower_with_under

C/C++

TypePublic
Filesmy_userful_class.cc
ClassesMyExcitingClass / MyExcitingEnum
Variablestable_name
Instance Variablestable_name_
ConstantskDaysInAWeek
FunctionsMyExcitingMethod()