From f2f00ce6583f282d0a21ca4b6d4a80b3f937949c Mon Sep 17 00:00:00 2001 From: zhenyan121 <3367366583@qq.com> Date: Tue, 28 Apr 2026 09:33:07 +0800 Subject: [PATCH] ci: add automated code style checking --- .github/workflows/format-check.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/format-check.yml diff --git a/.github/workflows/format-check.yml b/.github/workflows/format-check.yml new file mode 100644 index 0000000..ee21990 --- /dev/null +++ b/.github/workflows/format-check.yml @@ -0,0 +1,24 @@ + +# .github/workflows/format-check.yml +name: Code Format Check + +on: + push: + branches: [ "main", "master" ] + pull_request: + branches: [ "main", "master" ] + +jobs: + clang-format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install clang-format + run: | + sudo apt-get update + sudo apt-get install -y clang-format + + - name: Check C++ code formatting + run: | + find src include -name "*.cpp" -o -name "*.hpp" | xargs clang-format --dry-run --Werror