Skip to content

Commit 23bc20b

Browse files
authored
Bump clang-format requirement from v12 to v20 (#1321)
The version in .pre-commit-config.yaml isn't bumped from v12.0.1 to v20.1.0 here as the GitHub Actions workflow triggers for it differ: - pre-commit fires on `pull_request` and `push`, so needs to be changed at the same time as the formating changes - `PR_clang-format_test` fires on `pull_request_target`, so needs to be merged before the formatting changes
1 parent d37193a commit 23bc20b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

.github/workflows/PR_clang-format_test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
# Any changes to this script will not be run until it is merged into
1717
# the main repo.
1818

19-
# This script is used to do a quick and dirty clang-format v12 check on the
19+
# This script is used to do a quick and dirty clang-format v20 check on the
2020
# PR source repo to ensure it is formatted correctly. It will initially set
2121
# the AT: WIP label to try to stop the Autottester from processing the PR, and
2222
# then perform the clang-format test using a 3rd party action. It will then
@@ -67,12 +67,12 @@ jobs:
6767

6868
# Running the github action for clang format
6969
- name: Run Action clang-format-lint
70-
uses: DoozyX/clang-format-lint-action@c71d0bf4e21876ebec3e5647491186f8797fde31 # v0.18.2
70+
uses: DoozyX/clang-format-lint-action@bcb4eb2cb0d707ee4f3e5cc3b456eb075f12cf73 # v0.20
7171
with:
7272
source: './sst-core_source/'
7373
exclude: './sst-core_source/src/sst/core/libltdl ./sst-core_source/external ./sst-core_source/build'
7474
extensions: 'h,cc'
75-
clangFormatVersion: 12
75+
clangFormatVersion: 20
7676
inplace: False
7777

7878
#############################################
@@ -116,7 +116,7 @@ jobs:
116116
issue_number: context.issue.number,
117117
owner: context.repo.owner,
118118
repo: context.repo.repo,
119-
body: '**CLANG-FORMAT TEST - FAILED** (on last commit): <br>Run > ./scripts/clang-format-test.sh using clang-format v12 to check formatting'
119+
body: '**CLANG-FORMAT TEST - FAILED** (on last commit): <br>Run > ./scripts/clang-format-test.sh using clang-format v20 to check formatting'
120120
})
121121
if: ${{ failure() }}
122122

scripts/clang-format-test.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ echo "Using clang-format ${CLANG_FORMAT_EXE} with arguments ${CLANG_FORMAT_ARG}.
3838

3939
clang_format_version="$(${CLANG_FORMAT_EXE} --version)"
4040
currentver="$( ${CLANG_FORMAT_EXE} --version | sed 's/^.*[^0-9]\([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/' | sed 's/\.//g')"
41-
if [ "${currentver:=0}" -lt 1200 ]; then
42-
echo "clang-format version is $clang_format_version. We require version 12."
41+
if [ "${currentver:=0}" -lt 2000 ]; then
42+
echo "clang-format version is $clang_format_version. We require version 20."
4343
exit 1
4444
fi
4545

46-
if [ "${currentver:=0}" -ge 1300 ]; then
47-
echo "clang-format version is $clang_format_version. We require version 12."
46+
if [ "${currentver:=0}" -ge 2100 ]; then
47+
echo "clang-format version is $clang_format_version. We require version 20."
4848
exit 1
4949
fi
5050

0 commit comments

Comments
 (0)