代码风格

iLogtail C++遵循基于Google代码规范的风格,详细格式约束见.clang-format

Go遵循Effective Go风格。

Markdown遵循基于markdownlint的风格,并为了兼容GitBook排除MD033

格式化C++代码

使用VSCode的Clang-Format (by xaver)插件。

或使用命令行进行格式化

find core/ -type f -iname '*.h' -o -iname '*.cpp' | xargs clang-format -i

格式化Go代码

使用VSCode的Go (by Go Team at Google)插件。

或使用命令行进行格式化

find ./ -type f -iname '*.go' -not -iname '*.pb.go' | grep -E -v '/external/' | xargs gofmt -w

格式化Markdown

使用VSCode的Markdownlint (by David Anson)插件。

Last updated