使用gitlab CI检查编码样式



我使用clang格式来格式化我的源代码,我想验证编码gitlab CI.中的样式(变量名préfix,缩进,…(

我已经使用代码质量来检查变量scope。

我想在代码质量中添加编码样式验证。

有人知道怎么做吗?

ps:我不是gitllab CI专家。

我找到了这个解决方案,将闲置行添加到.gitlab-ci.yml:

format:
stage: test
image: nexus.lumiplan.com:8443/toolchain/clang-format:13
needs: []
script:
- find rootToYourProject ( ( -name *.cpp -o -name *.h ) -a ! -iname *soap* ) -print0 | xargs -0 -n 1 clang-format-13 --Werror -n --verbose
only:
- merge_requests

使用这个脚本,我对除soap文件外的所有.cpp.h文件进行clang格式配置验证。

最新更新