Skip to content

Commit

Permalink
common: fix - clang-format update from 9.0 to 14.0
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Gromadzki <[email protected]>
  • Loading branch information
grom72 committed Jan 29, 2025
1 parent 724b20b commit 64bd519
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Before contributing please remember to run:
```

This will check all C/C++ files in the tree for style issues. To check C++
files you have to have clang-format version 9.0, otherwise they will be
files you have to have clang-format version 14.0, otherwise they will be
skipped. If you want to run this target automatically at build time, you can
pass CSTYLEON=1 to make. If you want cstyle to be run, but not fail the build,
pass CSTYLEON=2 to make.
Expand Down
5 changes: 3 additions & 2 deletions src/common.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2014-2023, Intel Corporation
# Copyright 2025 Hewlett Packard Enterprise Development LP
#
# src/common.inc -- common Makefile rules for PMDK
#
Expand Down Expand Up @@ -39,8 +40,8 @@ $(error Cannot evaluate version)
endif

ifeq ($(CLANG_FORMAT),)
ifeq ($(shell command -v clang-format-9 > /dev/null && echo y || echo n), y)
export CLANG_FORMAT ?= clang-format-9
ifeq ($(shell command -v clang-format-14 > /dev/null && echo y || echo n), y)
export CLANG_FORMAT ?= clang-format-14
else
export CLANG_FORMAT ?= clang-format
endif
Expand Down
4 changes: 2 additions & 2 deletions utils/style_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ CHECK_TYPE=$1
# When updating, please search for all references to "clang-format" and update
# them as well; at this time these are CONTRIBUTING.md src/common.inc and
# docker images.
[ -z "$clang_format_bin" ] && which clang-format-9 >/dev/null &&
clang_format_bin=clang-format-9
[ -z "$clang_format_bin" ] && which clang-format-14 >/dev/null &&
clang_format_bin=clang-format-14
[ -z "$clang_format_bin" ] && which clang-format >/dev/null &&
clang_format_bin=clang-format
[ -z "$clang_format_bin" ] && clang_format_bin=clang-format
Expand Down

0 comments on commit 64bd519

Please sign in to comment.