From 1168acca72bf0f77dc789149dc60a19ea1939aed Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Tue, 24 Sep 2024 20:22:53 -0700 Subject: [PATCH 01/15] prepare for rust pkg tests --- .github/workflows/cpp-lint-package.yml | 6 +++++- src/demo.cpp | 3 +-- src/demo.hpp | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cpp-lint-package.yml b/.github/workflows/cpp-lint-package.yml index 09aac51..7c734f0 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -7,6 +7,7 @@ on: description: 'which branch to test' default: 'main' required: true + pull_request: jobs: cpp-linter: @@ -31,7 +32,10 @@ jobs: python-version: 3.x - name: Install workflow deps - run: python -m pip install clang-tools git+https://github.com/${{ matrix.repo }}/@${{ matrix.branch }} + # run: python -m pip install clang-tools git+https://github.com/${{ matrix.repo }}/@${{ matrix.branch }} + run: | + python -m pip install clang-tools + python -m pip install -i https://test.pypi.org/simple/ cpp-linter - name: Install clang-tools run: clang-tools --install ${{ matrix.clang-version }} --directory ${{ runner.temp }}/llvm diff --git a/src/demo.cpp b/src/demo.cpp index 0c1db60..6d17b23 100644 --- a/src/demo.cpp +++ b/src/demo.cpp @@ -8,8 +8,7 @@ size_t dummyFunc(size_t i) { return i; } int main() { - for (;;) - break; + for (;;) break; printf("Hello world!\n"); diff --git a/src/demo.hpp b/src/demo.hpp index 2695731..c9f634c 100644 --- a/src/demo.hpp +++ b/src/demo.hpp @@ -7,7 +7,7 @@ class Dummy { int numb; public: - void *not_usefull(char *str){ + void *not_useful(char *str){ useless = str; return 0; } From 385e0c49febc9b9c15d16aa7aae98c60e2865e90 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 26 Sep 2024 17:43:03 -0700 Subject: [PATCH 02/15] enable PR reviews --- .github/workflows/cpp-lint-package.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/cpp-lint-package.yml b/.github/workflows/cpp-lint-package.yml index 7c734f0..aa01f21 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -71,6 +71,8 @@ jobs: --extra-arg="-std=c++14 -Wall" --thread-comments=${{ matrix.clang-version == '17' && 'update' }} -a=${{ matrix.clang-version == '17' }} + --tidy-review=${{ matrix.clang-version == '17' }} + --format-review=${{ matrix.clang-version == '17' }} - name: Fail fast?! if: steps.linter.outputs.checks-failed > 0 From 596b514a6785f692f85161d0aefa5ecb75ce2ce8 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Wed, 2 Oct 2024 02:31:05 -0700 Subject: [PATCH 03/15] switch to main branch --- .github/workflows/cpp-lint-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cpp-lint-package.yml b/.github/workflows/cpp-lint-package.yml index aa01f21..10f6485 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -35,7 +35,7 @@ jobs: # run: python -m pip install clang-tools git+https://github.com/${{ matrix.repo }}/@${{ matrix.branch }} run: | python -m pip install clang-tools - python -m pip install -i https://test.pypi.org/simple/ cpp-linter + python -m pip install git+https://github.com/cpp-linter/cpp_linter_rs.git@main#subdirectory=py-binding - name: Install clang-tools run: clang-tools --install ${{ matrix.clang-version }} --directory ${{ runner.temp }}/llvm From 9ea38bf92b4b87660a5ce081130b4463444807ca Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Wed, 2 Oct 2024 02:38:17 -0700 Subject: [PATCH 04/15] enable color logs --- .github/workflows/cpp-lint-package.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cpp-lint-package.yml b/.github/workflows/cpp-lint-package.yml index 10f6485..0df5bc5 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -60,6 +60,7 @@ jobs: id: linter env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CPP_LINTER_COLOR: true run: > cpp-linter -s=file From 2e9a6fc6a33550b967f167814e2ead8f5fa262f4 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 12 Dec 2024 08:17:43 -0800 Subject: [PATCH 05/15] update src/demo.* and clang configs --- .clang-format | 2 +- .clang-tidy | 1 + src/demo.cpp | 18 ++++++++++-------- src/demo.hpp | 11 +++-------- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/.clang-format b/.clang-format index d46a1d5..1dd236c 100644 --- a/.clang-format +++ b/.clang-format @@ -1,3 +1,3 @@ --- Language: Cpp -BasedOnStyle: WebKit \ No newline at end of file +BasedOnStyle: WebKit diff --git a/.clang-tidy b/.clang-tidy index 77d52bd..ba11304 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -182,3 +182,4 @@ CheckOptions: value: '1' - key: readability-uppercase-literal-suffix.NewSuffixes value: '' +... diff --git a/src/demo.cpp b/src/demo.cpp index 6d17b23..1bf553e 100644 --- a/src/demo.cpp +++ b/src/demo.cpp @@ -1,16 +1,18 @@ /** This is a very ugly test code (doomed to fail linting) */ #include "demo.hpp" -#include -#include +#include -// using size_t from cstddef -size_t dummyFunc(size_t i) { return i; } -int main() -{ + + +int main(){ + for (;;) break; + printf("Hello world!\n"); - return 0; -} + + + + return 0;} diff --git a/src/demo.hpp b/src/demo.hpp index c9f634c..f93d012 100644 --- a/src/demo.hpp +++ b/src/demo.hpp @@ -5,12 +5,10 @@ class Dummy { char* useless; int numb; + Dummy() :numb(0), useless("\0"){} public: - void *not_useful(char *str){ - useless = str; - return 0; - } + void *not_useful(char *str){useless = str;} }; @@ -28,14 +26,11 @@ class Dummy { - - - - struct LongDiff { + long diff; }; From 591e7dcde76eafa3b422a2ce753d80dcb14b800f Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 12 Dec 2024 09:12:23 -0800 Subject: [PATCH 06/15] turn off line filter --- .github/workflows/cpp-lint-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cpp-lint-package.yml b/.github/workflows/cpp-lint-package.yml index 0df5bc5..736be08 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -68,7 +68,7 @@ jobs: -i=build -p=build -V=${{ runner.temp }}/llvm - -f=false + -l=false --extra-arg="-std=c++14 -Wall" --thread-comments=${{ matrix.clang-version == '17' && 'update' }} -a=${{ matrix.clang-version == '17' }} From c63d2ca2c739897e676657c8ec0c14695d922b8b Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Tue, 9 Jun 2026 18:41:15 -0700 Subject: [PATCH 07/15] install software-properties-common in linux container too --- .github/workflows/cpp-lint-action.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cpp-lint-action.yml b/.github/workflows/cpp-lint-action.yml index 87ce289..55ce199 100644 --- a/.github/workflows/cpp-lint-action.yml +++ b/.github/workflows/cpp-lint-action.yml @@ -33,7 +33,14 @@ jobs: if: matrix.os == 'ubuntu-latest' run: >- apt-get update && - apt-get install -y libc6 cmake gcc g++ wget lsb-release + apt-get install -y + libc6 + cmake + gcc + g++ + wget + software-properties-common + lsb-release - name: Generate compilation database if: steps.cache-build.outputs.cache-hit != 'true' run: mkdir build && cmake -Bbuild src From aaba24c7e88d85e17960906ef507e224be661b55 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 12 Dec 2024 12:40:23 -0800 Subject: [PATCH 08/15] bump to v2.0.0rc18 and try cpp-linter-action v3.0-rc0 branch --- .github/workflows/cpp-lint-action.yml | 5 +++-- .github/workflows/cpp-lint-package.yml | 15 ++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cpp-lint-action.yml b/.github/workflows/cpp-lint-action.yml index 55ce199..7125a31 100644 --- a/.github/workflows/cpp-lint-action.yml +++ b/.github/workflows/cpp-lint-action.yml @@ -3,6 +3,7 @@ name: cpp-linter as action on: workflow_dispatch: workflow_call: + pull_request: jobs: @@ -43,10 +44,10 @@ jobs: lsb-release - name: Generate compilation database if: steps.cache-build.outputs.cache-hit != 'true' - run: mkdir build && cmake -Bbuild src + run: mkdir build && cmake build src - name: Run linter as action - uses: cpp-linter/cpp-linter-action@main + uses: cpp-linter/cpp-linter-action@v3.0.0-rc0 id: linter env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/cpp-lint-package.yml b/.github/workflows/cpp-lint-package.yml index 736be08..fc8a0ae 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -7,7 +7,7 @@ on: description: 'which branch to test' default: 'main' required: true - pull_request: + # pull_request: jobs: cpp-linter: @@ -16,7 +16,7 @@ jobs: strategy: matrix: clang-version: ['11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22'] - repo: ['cpp-linter/cpp-linter'] + repo: ['cpp-linter/cpp-linter-rs'] branch: ['${{ inputs.branch }}'] fail-fast: false @@ -33,12 +33,13 @@ jobs: - name: Install workflow deps # run: python -m pip install clang-tools git+https://github.com/${{ matrix.repo }}/@${{ matrix.branch }} + # python -m pip install clang-tools + # python -m pip install git+https://github.com/${{ matrix.repo }}.git@${{ matrix.branch }} run: | - python -m pip install clang-tools - python -m pip install git+https://github.com/cpp-linter/cpp_linter_rs.git@main#subdirectory=py-binding + python -m pip install -i https://test.pypi.org/simple/ cpp-linter==2.0.0rc18 - - name: Install clang-tools - run: clang-tools --install ${{ matrix.clang-version }} --directory ${{ runner.temp }}/llvm + # - name: Install clang-tools + # run: clang-tools --install ${{ matrix.clang-version }} --directory ${{ runner.temp }}/llvm - name: Setup VS dev env uses: TheMrMilchmann/setup-msvc-dev@v4 @@ -67,7 +68,7 @@ jobs: -v=debug -i=build -p=build - -V=${{ runner.temp }}/llvm + -V=${{ matrix.clang-version }} -l=false --extra-arg="-std=c++14 -Wall" --thread-comments=${{ matrix.clang-version == '17' && 'update' }} From 55a89841a62383dc4345e0af1227b6fcf901bc02 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Sun, 21 Jun 2026 14:29:03 -0700 Subject: [PATCH 09/15] bump to cppv2.0.0-rc19 --- .github/workflows/cpp-lint-package.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cpp-lint-package.yml b/.github/workflows/cpp-lint-package.yml index fc8a0ae..8ac2da3 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -36,7 +36,7 @@ jobs: # python -m pip install clang-tools # python -m pip install git+https://github.com/${{ matrix.repo }}.git@${{ matrix.branch }} run: | - python -m pip install -i https://test.pypi.org/simple/ cpp-linter==2.0.0rc18 + python -m pip install -i https://test.pypi.org/simple/ cpp-linter==2.0.0rc19 # - name: Install clang-tools # run: clang-tools --install ${{ matrix.clang-version }} --directory ${{ runner.temp }}/llvm @@ -73,8 +73,7 @@ jobs: --extra-arg="-std=c++14 -Wall" --thread-comments=${{ matrix.clang-version == '17' && 'update' }} -a=${{ matrix.clang-version == '17' }} - --tidy-review=${{ matrix.clang-version == '17' }} - --format-review=${{ matrix.clang-version == '17' }} + --pr-review=${{ matrix.clang-version == '17' }} - name: Fail fast?! if: steps.linter.outputs.checks-failed > 0 From 7301574f21c6ed942fbfcd95c222ad2be3131c03 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Tue, 23 Jun 2026 03:35:06 -0700 Subject: [PATCH 10/15] fix CMake cmd keeps build artifacts in the build/ folder --- .github/workflows/cpp-lint-action.yml | 2 +- .github/workflows/cpp-lint-package.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cpp-lint-action.yml b/.github/workflows/cpp-lint-action.yml index 7125a31..44daa9d 100644 --- a/.github/workflows/cpp-lint-action.yml +++ b/.github/workflows/cpp-lint-action.yml @@ -44,7 +44,7 @@ jobs: lsb-release - name: Generate compilation database if: steps.cache-build.outputs.cache-hit != 'true' - run: mkdir build && cmake build src + run: mkdir build && cmake -B build -S src - name: Run linter as action uses: cpp-linter/cpp-linter-action@v3.0.0-rc0 diff --git a/.github/workflows/cpp-lint-package.yml b/.github/workflows/cpp-lint-package.yml index 8ac2da3..0921f5c 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -55,7 +55,7 @@ jobs: - name: Generate compiler database if: steps.cache-build.outputs.cache-hit != 'true' - run: mkdir build && cmake -Bbuild src -G "NMake Makefiles" + run: mkdir build && cmake -B build -S src -G "NMake Makefiles" - name: Run linter as package id: linter From c154e567476530838ac757732e40d05229134dda Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Tue, 23 Jun 2026 03:50:16 -0700 Subject: [PATCH 11/15] switch to pkg CI --- .github/workflows/cpp-lint-action.yml | 2 +- .github/workflows/cpp-lint-package.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cpp-lint-action.yml b/.github/workflows/cpp-lint-action.yml index 44daa9d..1241144 100644 --- a/.github/workflows/cpp-lint-action.yml +++ b/.github/workflows/cpp-lint-action.yml @@ -3,7 +3,7 @@ name: cpp-linter as action on: workflow_dispatch: workflow_call: - pull_request: + # pull_request: jobs: diff --git a/.github/workflows/cpp-lint-package.yml b/.github/workflows/cpp-lint-package.yml index 0921f5c..1286689 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -7,7 +7,7 @@ on: description: 'which branch to test' default: 'main' required: true - # pull_request: + pull_request: jobs: cpp-linter: From 0600e2f130270d7f763815a761f4e38d3666f55e Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Tue, 23 Jun 2026 04:12:39 -0700 Subject: [PATCH 12/15] enable step summary --- .github/workflows/cpp-lint-action.yml | 1 + .github/workflows/cpp-lint-package.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/cpp-lint-action.yml b/.github/workflows/cpp-lint-action.yml index 1241144..bf0f157 100644 --- a/.github/workflows/cpp-lint-action.yml +++ b/.github/workflows/cpp-lint-action.yml @@ -62,6 +62,7 @@ jobs: thread-comments: ${{ matrix.clang-version == '17' && 'update' }} file-annotations: ${{ matrix.clang-version == '17' }} extra-args: -std=c++14 -Wall + step-summary: true - name: Fail fast?! # if: steps.linter.outputs.checks-failed > 0 diff --git a/.github/workflows/cpp-lint-package.yml b/.github/workflows/cpp-lint-package.yml index 1286689..730a6b3 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -70,6 +70,7 @@ jobs: -p=build -V=${{ matrix.clang-version }} -l=false + --step-summary=true --extra-arg="-std=c++14 -Wall" --thread-comments=${{ matrix.clang-version == '17' && 'update' }} -a=${{ matrix.clang-version == '17' }} From a34af556bb5edb3cc9b5e31f26c16638a8688dfc Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Sun, 28 Jun 2026 02:42:34 -0700 Subject: [PATCH 13/15] apply patch fixes as a dry run demo --- .github/workflows/cpp-lint-action.yml | 9 +++++++++ .github/workflows/cpp-lint-package.yml | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/.github/workflows/cpp-lint-action.yml b/.github/workflows/cpp-lint-action.yml index bf0f157..7222746 100644 --- a/.github/workflows/cpp-lint-action.yml +++ b/.github/workflows/cpp-lint-action.yml @@ -73,3 +73,12 @@ jobs: echo "clang-tidy: ${{ steps.linter.outputs.clang-tidy-checks-failed }}" # for actual deployment # run: exit 1 + + - name: Apply patch + if: steps.linter.outputs.fix-patch-path != '' + shell: bash + env: + PATCH_PATH: ${{ steps.linter.outputs.fix-patch-path }} + run: |- + echo "applying patch" + git apply ${PATCH_PATH} diff --git a/.github/workflows/cpp-lint-package.yml b/.github/workflows/cpp-lint-package.yml index 730a6b3..f9a941d 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -85,3 +85,11 @@ jobs: echo "clang-tidy: ${{ steps.linter.outputs.clang-tidy-checks-failed }}" # for actual deployment # run: exit 1 + + - name: Apply patch + if: steps.linter.outputs.fix-patch-path != '' + env: + PATCH_PATH: ${{ steps.linter.outputs.fix-patch-path }} + run: |- + echo "applying patch" + git apply $env:PATCH_PATH \ No newline at end of file From 2c6a2414185f0d1b4ae766868f11580a130c5465 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Tue, 14 Jul 2026 16:57:37 -0700 Subject: [PATCH 14/15] remove clang v11 from matrix --- .github/workflows/cpp-lint-action.yml | 2 +- .github/workflows/cpp-lint-package.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cpp-lint-action.yml b/.github/workflows/cpp-lint-action.yml index 7222746..d9464dd 100644 --- a/.github/workflows/cpp-lint-action.yml +++ b/.github/workflows/cpp-lint-action.yml @@ -11,7 +11,7 @@ jobs: strategy: matrix: os: [ ubuntu-latest, macos-latest, windows-latest ] - clang-version: ['11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22'] + clang-version: ['12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22'] fail-fast: false runs-on: ${{ matrix.os }} diff --git a/.github/workflows/cpp-lint-package.yml b/.github/workflows/cpp-lint-package.yml index f9a941d..d8bab8d 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -15,7 +15,7 @@ jobs: strategy: matrix: - clang-version: ['11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22'] + clang-version: ['12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22'] repo: ['cpp-linter/cpp-linter-rs'] branch: ['${{ inputs.branch }}'] fail-fast: false From c7ca6b7297eae9228a346f4c15b9e8a11199eecc Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Wed, 24 Jun 2026 01:08:24 -0700 Subject: [PATCH 15/15] bump to cpp-linter v2.0.0-rc22 --- .github/workflows/cpp-lint-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cpp-lint-package.yml b/.github/workflows/cpp-lint-package.yml index d8bab8d..9cb602f 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -36,7 +36,7 @@ jobs: # python -m pip install clang-tools # python -m pip install git+https://github.com/${{ matrix.repo }}.git@${{ matrix.branch }} run: | - python -m pip install -i https://test.pypi.org/simple/ cpp-linter==2.0.0rc19 + python -m pip install -i https://test.pypi.org/simple/ cpp-linter==2.0.0rc22 # - name: Install clang-tools # run: clang-tools --install ${{ matrix.clang-version }} --directory ${{ runner.temp }}/llvm