image: docker:git stages: - checks check-lint: image: xianpengshen/clang-tools:14 stage: checks script: - linter_errors=$(clang-format -n ./src/* ./include/* 2>&1 | grep -v --color=never "no modified files to format" || true) - echo "$linter_errors" - if [[ ! -z "$linter_errors" ]]; then echo "Detected formatting issues; please fix"; exit 1; else echo "Formatting is correct"; exit 0; fi