From 4ea15ed85ad91ffd52878ca4c6f3520bf90a4357 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Thu, 16 Apr 2026 01:05:03 +0200 Subject: [PATCH] Touch up `checkformat.bash` The logic can be slightly simplified, and the script doesn't require Bash after all. --- .github/workflows/checkformat.yml | 2 +- contrib/{checkformat.bash => checkformat.sh} | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename contrib/{checkformat.bash => checkformat.sh} (66%) diff --git a/.github/workflows/checkformat.yml b/.github/workflows/checkformat.yml index 0119fc56..06f1f2be 100644 --- a/.github/workflows/checkformat.yml +++ b/.github/workflows/checkformat.yml @@ -16,4 +16,4 @@ jobs: - name: Check format run: | sudo apt install clang-format - contrib/checkformat.bash + contrib/checkformat.sh diff --git a/contrib/checkformat.bash b/contrib/checkformat.sh similarity index 66% rename from contrib/checkformat.bash rename to contrib/checkformat.sh index bcf11b1a..7a5e2c8b 100755 --- a/contrib/checkformat.bash +++ b/contrib/checkformat.sh @@ -1,10 +1,10 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh # SPDX-License-Identifier: MIT clang-format --version -find . -type f \( -iname '*.hpp' -o -iname '*.cpp' \) -exec clang-format -i {} + +find . -type f -iname '*.[ch]pp' -exec clang-format -i {} + if ! git diff-index --quiet HEAD --; then echo 'Unformatted files:'