From 97770e9b9a0b3b3a986a83f9d7cb84d5ffeb16a5 Mon Sep 17 00:00:00 2001 From: Xianpeng Shen Date: Sat, 31 Oct 2026 15:27:51 +0200 Subject: [PATCH] test: try the format check sub-action on a change --- .github/workflows/format-check.yml | 30 ++++++++++++++++++++++++++++++ src/demo.hpp | 3 +++ 2 files changed, 33 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..2c36fc6 --- /dev/null +++ b/.github/workflows/format-check.yml @@ -0,0 +1,30 @@ +name: format check (sub-action e2e) + +on: + push: + branches: [claude/project-thread-np880h] + pull_request: + branches: [master] + +permissions: + contents: read + +jobs: + format: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + fail-fast: false + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v6 + # Expected: fails, with one annotation on src/demo.hpp line 44 only. + # The old mis-formatted lines in src/demo.hpp are not part of the change. + - uses: cpp-linter/cpp-linter-action/format@claude/project-thread-np880h + id: fmt + continue-on-error: true + - name: Assert + shell: bash + run: | + echo "outcome=${{ steps.fmt.outcome }} checks-failed=${{ steps.fmt.outputs.checks-failed }} version=${{ steps.fmt.outputs.clang-format-version }}" + [ "${{ steps.fmt.outcome }}" = failure ] && [ "${{ steps.fmt.outputs.checks-failed }}" = 1 ] diff --git a/src/demo.hpp b/src/demo.hpp index 2695731..7d8ed12 100644 --- a/src/demo.hpp +++ b/src/demo.hpp @@ -39,3 +39,6 @@ struct LongDiff long diff; }; + +int formattedDecl(int a); +int badly_spaced( int a );