Skip to content

Commit 286ae43

Browse files
committed
fixup! chore: bump linter action deps
1 parent d10649c commit 286ae43

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

.github/workflows/linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ concurrency:
2222

2323
jobs:
2424
lint:
25-
runs-on: ubuntu-slim
25+
runs-on: ubuntu-latest
2626
steps:
2727
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
2828

tools/run-clang-format.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ COMMAND=$*
2424
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
2525
MAINSOURCE=$SCRIPTPATH/..
2626
ALL_FILES=$(cd $MAINSOURCE && git ls-tree --full-tree --name-only -r HEAD | grep -e ".*\.\(c\|h\|cc\|cpp\|hh\)\$")
27+
CLANG_FORMAT_MAJOR_VERSION=17
2728

28-
if clang-format-17 --version 2>/dev/null | grep -qF 'version 17.'; then
29-
cd $MAINSOURCE; clang-format-17 --style=file --verbose -i "$@" $ALL_FILES
29+
if "clang-format-$CLANG_FORMAT_MAJOR_VERSION" --version 2>/dev/null | grep -qF "version $CLANG_FORMAT_MAJOR_VERSION."; then
30+
cd $MAINSOURCE; "clang-format-$CLANG_FORMAT_MAJOR_VERSION" --style=file --verbose -i "$@" $ALL_FILES
3031
exit 0
31-
elif clang-format --version 2>/dev/null | grep -qF 'version 17.'; then
32+
elif clang-format --version 2>/dev/null | grep -qF "version $CLANG_FORMAT_MAJOR_VERSION."; then
3233
cd $MAINSOURCE; clang-format --style=file --verbose -i "$@" $ALL_FILES
3334
exit 0
3435
fi
@@ -37,6 +38,10 @@ command -v docker >/dev/null 2>&1 || { echo >&2 "Please install docker. E.g., go
3738
docker info >/dev/null 2>&1 || { echo >&2 "Docker server is not running? type 'docker info'."; exit 1; }
3839

3940
if [ -t 0 ]; then DOCKER_ARGS=-it; fi
40-
docker pull kszonek/clang-format-17
4141

42-
docker run --rm $DOCKER_ARGS -v "$MAINSOURCE":"$MAINSOURCE":Z -w "$MAINSOURCE" -u "$(id -u $USER):$(id -g $USER)" kszonek/clang-format-17 --style=file --verbose -i "$@" $ALL_FILES
42+
docker run --rm $DOCKER_ARGS \
43+
-v "$MAINSOURCE":"$MAINSOURCE":Z \
44+
-w "$MAINSOURCE" \
45+
-u "$(id -u $USER):$(id -g $USER)" \
46+
"ghcr.io/jidicula/clang-format:$CLANG_FORMAT_MAJOR_VERSION" \
47+
--style=file --verbose -i "$@" $ALL_FILES

0 commit comments

Comments
 (0)