I use clang-format to format my source code and I want to verify the coding style(variable name préfix, indentation, ...) in gitlab CI.
I already use code quality to check variable scop.
I want to add coding style verify in code quality.
someone know how to do that ?
ps: I am not a gitllab CI specialist.
I have found this solution, add fallowing lines to .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
With this script I do a verification of my clang format configuration to all .cpp and .h files excepted for soap files.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With