diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8346e92f7..fb49526ee 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,7 +40,7 @@ jobs: - name: Install dependencies run: | sudo pip install flake8 - sudo apt-get install clang-format-14 + sudo apt-get install clang-format - name: Check license id: check_license diff --git a/src/Makefile b/src/Makefile index 154ebe246..9bfc3fe5f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,5 +1,6 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright 2014-2023, Intel Corporation +# Copyright 2026, Hewlett Packard Enterprise Development LP # # src/Makefile -- Makefile for PMDK @@ -15,6 +16,9 @@ ALL_TARGETS = $(TARGETS) common core # all available targets POSSIBLE_TARGETS = $(TARGETS) common core test\ examples benchmarks +# Exclude benchmarks from cstyle due to clang-format version differences. +CSTYLE_TARGETS = $(TARGETS) common core test\ + examples SCOPE_DIRS = $(TARGETS) common core @@ -33,7 +37,6 @@ endif CLEAN_TARGETS = $(POSSIBLE_TARGETS) CLOBBER_TARGETS = $(POSSIBLE_TARGETS) -CSTYLE_TARGETS = $(POSSIBLE_TARGETS) INSTALL_TARGETS = $(TARGETS) SPARSE_TARGETS = $(POSSIBLE_TARGETS) EXAMPLES_TARGETS = $(TARGETS) diff --git a/utils/style_check.sh b/utils/style_check.sh index 2d764131f..617ad6458 100755 --- a/utils/style_check.sh +++ b/utils/style_check.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause # Copyright 2016-2023, Intel Corporation -# Copyright 2025, Hewlett Packard Enterprise Development LP +# Copyright 2025-2026, Hewlett Packard Enterprise Development LP # # utils/style_check.sh -- common style checking script # @@ -30,24 +30,22 @@ function usage() { } # -# require clang-format version 14.0 +# require clang-format # function check_clang_version() { - set +e - which ${clang_format_bin} &> /dev/null && ${clang_format_bin} --version |\ - grep "version 14\.0"\ - &> /dev/null - if [ $? -ne 0 ]; then - 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 + set +e + which ${clang_format_bin} > /dev/null 2>&1 + if [ $? -ne 0 ]; then + MSG="requires clang-format" + 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 } #