Skip to content

Commit

Permalink
common: introduce the CSTYLE_FAIL_IF_CLANG_FORMAT_MISSING flag
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Michalski <jan.michalski@intel.com>
  • Loading branch information
janekmi committed Aug 6, 2023
1 parent 02703dd commit 64c2156
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 8 additions & 2 deletions utils/style_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 64c2156

Please sign in to comment.