diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a5b6b8f9af6..415defebb5e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,6 +28,7 @@ jobs: - name: Check style env: + CSTYLE_FAIL_IF_CLANG_FORMAT_MISSING: 1 NDCTL_ENABLE: n # just to speed up the job run: make -j$(nproc) cstyle diff --git a/utils/style_check.sh b/utils/style_check.sh index 681a09160fe..34f5688fd7a 100755 --- a/utils/style_check.sh +++ b/utils/style_check.sh @@ -37,8 +37,14 @@ function check_clang_version() { grep "version 14\.0"\ &> /dev/null if [ $? -ne 0 ]; then - echo "SKIP: requires clang-format version==14.0" - exit 0 + MSG="requires clang-format version==14.0" + if [ "x$CSTYLE_FAIL_IF_CLANG_FORMAT_MISSING" == "x1" ]; then + echo "FAIL: $MSG" + exit 1 + else + echo "SKIP: $MSG" + exit 0 + fi fi set -e }