Skip to content

temp: trigger CI

temp: trigger CI #4

Workflow file for this run

name: Clang-Format Check
on:
push:
branches: [formatting]
pull_request:
paths:
- '**/*.cpp'
- '**/*.h'
- '**/*.hpp'
jobs:
clang-format-check:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Clang-Format
run: sudo apt-get install -y clang-format
- name: Run Clang-Format Check
run: |
files=$(find . -name "*.cpp" -o -name "*.hpp" -o -name "*.h")
echo "Files: $files"
check_ignore=$(git -c core.excludesFile="format-ignore.txt" check-ignore --stdin --no-index --non-matching --verbose <<< "$files")
echo "Check ignore output: $check_ignore"
files=$(awk '/^::/ {print $2}' <<< "$check_ignore")
echo "Files to check: $files"
echo "Checking $(echo "$files" | wc -l) files"
if [ -n "$files" ]; then
clang-format -style=file -i $files
git diff --exit-code || (echo "Clang-Format check failed!" && exit 1)
else
echo "No files to check."
fi