From d10649c48ff7f0e7f86f56936012d2fddb6bafb4 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 18 Feb 2026 10:53:25 +0100 Subject: [PATCH 1/6] chore: bump linter action deps --- .github/workflows/linter.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 0241386..9e5e2cc 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -22,17 +22,17 @@ concurrency: jobs: lint: - runs-on: ubuntu-latest + runs-on: ubuntu-slim steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Run clang-format - uses: jidicula/clang-format-action@c74383674bf5f7c69f60ce562019c1c94bc1421a # v4.13.0 + uses: jidicula/clang-format-action@6cd220de46c89139a0365edae93eee8eb30ca8fe # v4.16.0 with: clang-format-version: '17' fallback-style: 'Google' - - uses: chartboost/ruff-action@e18ae971ccee1b2d7bbef113930f00c670b78da4 # v1.0.0 + - uses: astral-sh/ruff-action@4919ec5cf1f49eff0871dbcea0da843445b837e6 # v3.6.1 name: Lint with Ruff with: version: 0.5.1 From 286ae437fcb417638a52a6a62d4994e0182c8200 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 18 Feb 2026 11:04:19 +0100 Subject: [PATCH 2/6] fixup! chore: bump linter action deps --- .github/workflows/linter.yml | 2 +- tools/run-clang-format.sh | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 9e5e2cc..7e9a41c 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -22,7 +22,7 @@ concurrency: jobs: lint: - runs-on: ubuntu-slim + runs-on: ubuntu-latest steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 diff --git a/tools/run-clang-format.sh b/tools/run-clang-format.sh index ce1a664..e4f0c08 100755 --- a/tools/run-clang-format.sh +++ b/tools/run-clang-format.sh @@ -24,11 +24,12 @@ COMMAND=$* SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" MAINSOURCE=$SCRIPTPATH/.. ALL_FILES=$(cd $MAINSOURCE && git ls-tree --full-tree --name-only -r HEAD | grep -e ".*\.\(c\|h\|cc\|cpp\|hh\)\$") +CLANG_FORMAT_MAJOR_VERSION=17 -if clang-format-17 --version 2>/dev/null | grep -qF 'version 17.'; then - cd $MAINSOURCE; clang-format-17 --style=file --verbose -i "$@" $ALL_FILES +if "clang-format-$CLANG_FORMAT_MAJOR_VERSION" --version 2>/dev/null | grep -qF "version $CLANG_FORMAT_MAJOR_VERSION."; then + cd $MAINSOURCE; "clang-format-$CLANG_FORMAT_MAJOR_VERSION" --style=file --verbose -i "$@" $ALL_FILES exit 0 -elif clang-format --version 2>/dev/null | grep -qF 'version 17.'; then +elif clang-format --version 2>/dev/null | grep -qF "version $CLANG_FORMAT_MAJOR_VERSION."; then cd $MAINSOURCE; clang-format --style=file --verbose -i "$@" $ALL_FILES exit 0 fi @@ -37,6 +38,10 @@ command -v docker >/dev/null 2>&1 || { echo >&2 "Please install docker. E.g., go docker info >/dev/null 2>&1 || { echo >&2 "Docker server is not running? type 'docker info'."; exit 1; } if [ -t 0 ]; then DOCKER_ARGS=-it; fi -docker pull kszonek/clang-format-17 -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 +docker run --rm $DOCKER_ARGS \ + -v "$MAINSOURCE":"$MAINSOURCE":Z \ + -w "$MAINSOURCE" \ + -u "$(id -u $USER):$(id -g $USER)" \ + "ghcr.io/jidicula/clang-format:$CLANG_FORMAT_MAJOR_VERSION" \ + --style=file --verbose -i "$@" $ALL_FILES From 771be5c68a697118a61e12c1d2a06d067924370c Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 18 Feb 2026 11:10:35 +0100 Subject: [PATCH 3/6] squash! to drop --- .github/workflows/linter.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 7e9a41c..1d5a095 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -27,10 +27,7 @@ jobs: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Run clang-format - uses: jidicula/clang-format-action@6cd220de46c89139a0365edae93eee8eb30ca8fe # v4.16.0 - with: - clang-format-version: '17' - fallback-style: 'Google' + run: apt update && apt search clang-format - uses: astral-sh/ruff-action@4919ec5cf1f49eff0871dbcea0da843445b837e6 # v3.6.1 name: Lint with Ruff From 3d6291f794625577910dddcd1065b2aff6842768 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 18 Feb 2026 11:11:48 +0100 Subject: [PATCH 4/6] fixup! squash! to drop --- .github/workflows/linter.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 1d5a095..52811ed 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -22,12 +22,12 @@ concurrency: jobs: lint: - runs-on: ubuntu-latest + runs-on: ubuntu-slim steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Run clang-format - run: apt update && apt search clang-format + run: sudo apt update && apt search clang-format - uses: astral-sh/ruff-action@4919ec5cf1f49eff0871dbcea0da843445b837e6 # v3.6.1 name: Lint with Ruff From f570219e89e4e2dcaa51a99a1674c959de56e056 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 18 Feb 2026 11:13:01 +0100 Subject: [PATCH 5/6] squash! fix using apt --- .github/workflows/linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 52811ed..2524822 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -27,7 +27,7 @@ jobs: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - name: Run clang-format - run: sudo apt update && apt search clang-format + run: sudo apt update && sudo apt install clang-format-17 && tools/run-clang-format.sh - uses: astral-sh/ruff-action@4919ec5cf1f49eff0871dbcea0da843445b837e6 # v3.6.1 name: Lint with Ruff From b9a15b883c5b025537855fa7694ddc4e486830e7 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 18 Feb 2026 11:15:35 +0100 Subject: [PATCH 6/6] squash! remove unrelated change --- tools/run-clang-format.sh | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/tools/run-clang-format.sh b/tools/run-clang-format.sh index e4f0c08..ce1a664 100755 --- a/tools/run-clang-format.sh +++ b/tools/run-clang-format.sh @@ -24,12 +24,11 @@ COMMAND=$* SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )" MAINSOURCE=$SCRIPTPATH/.. ALL_FILES=$(cd $MAINSOURCE && git ls-tree --full-tree --name-only -r HEAD | grep -e ".*\.\(c\|h\|cc\|cpp\|hh\)\$") -CLANG_FORMAT_MAJOR_VERSION=17 -if "clang-format-$CLANG_FORMAT_MAJOR_VERSION" --version 2>/dev/null | grep -qF "version $CLANG_FORMAT_MAJOR_VERSION."; then - cd $MAINSOURCE; "clang-format-$CLANG_FORMAT_MAJOR_VERSION" --style=file --verbose -i "$@" $ALL_FILES +if clang-format-17 --version 2>/dev/null | grep -qF 'version 17.'; then + cd $MAINSOURCE; clang-format-17 --style=file --verbose -i "$@" $ALL_FILES exit 0 -elif clang-format --version 2>/dev/null | grep -qF "version $CLANG_FORMAT_MAJOR_VERSION."; then +elif clang-format --version 2>/dev/null | grep -qF 'version 17.'; then cd $MAINSOURCE; clang-format --style=file --verbose -i "$@" $ALL_FILES exit 0 fi @@ -38,10 +37,6 @@ command -v docker >/dev/null 2>&1 || { echo >&2 "Please install docker. E.g., go docker info >/dev/null 2>&1 || { echo >&2 "Docker server is not running? type 'docker info'."; exit 1; } if [ -t 0 ]; then DOCKER_ARGS=-it; fi +docker pull kszonek/clang-format-17 -docker run --rm $DOCKER_ARGS \ - -v "$MAINSOURCE":"$MAINSOURCE":Z \ - -w "$MAINSOURCE" \ - -u "$(id -u $USER):$(id -g $USER)" \ - "ghcr.io/jidicula/clang-format:$CLANG_FORMAT_MAJOR_VERSION" \ - --style=file --verbose -i "$@" $ALL_FILES +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