diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4f8c0dcbafd..415defebb5e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,9 @@ jobs: fetch-depth: 50 - name: Install dependencies - run: sudo pip install flake8 + run: | + sudo pip install flake8 + sudo apt-get install clang-format-14 - name: Check licenses env: @@ -26,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/src/benchmarks/pmembench.cpp b/src/benchmarks/pmembench.cpp index 5c73e2682ce..0f73242ff8b 100644 --- a/src/benchmarks/pmembench.cpp +++ b/src/benchmarks/pmembench.cpp @@ -1215,9 +1215,10 @@ scale_up_min_exe_time(struct benchmark *bench, struct benchmark_args *args, * scale up number of operations to get assumed minimal * execution time */ - args->n_ops_per_thread = (size_t)( - (double)args->n_ops_per_thread * - (min_exe_time + MIN_EXE_TIME_E) / total_res->total.min); + args->n_ops_per_thread = + (size_t)((double)args->n_ops_per_thread * + (min_exe_time + MIN_EXE_TIME_E) / + total_res->total.min); results_free(total_res); *total_results = results_alloc(args); diff --git a/utils/style_check.sh b/utils/style_check.sh index 37a09b9ac45..34f5688fd7a 100755 --- a/utils/style_check.sh +++ b/utils/style_check.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # SPDX-License-Identifier: BSD-3-Clause -# Copyright 2016-2022, Intel Corporation +# Copyright 2016-2023, Intel Corporation # # utils/style_check.sh -- common style checking script # @@ -29,16 +29,22 @@ function usage() { } # -# require clang-format version 9.0 +# require clang-format version 14.0 # function check_clang_version() { set +e which ${clang_format_bin} &> /dev/null && ${clang_format_bin} --version |\ - grep "version 9\.0"\ + grep "version 14\.0"\ &> /dev/null if [ $? -ne 0 ]; then - echo "SKIP: requires clang-format version 9.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 }