From f46a6f2583110977a65e040647351eb872a25434 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Tue, 24 Sep 2024 20:22:53 -0700 Subject: [PATCH 1/8] 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 2a4c6cc..08bf64f 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 98cb22d7eb24977c9d625f8af4de71aa450ca731 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 26 Sep 2024 17:43:03 -0700 Subject: [PATCH 2/8] 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 08bf64f..8dca101 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 8fd5a8fe2531abce5a6a96f9e1225b074a23286a Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Wed, 2 Oct 2024 02:31:05 -0700 Subject: [PATCH 3/8] 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 8dca101..055d655 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 356d61a66fec92222389d717a2762b4c9854febb Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Wed, 2 Oct 2024 02:38:17 -0700 Subject: [PATCH 4/8] 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 055d655..4578299 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 660905156fb9bf8ab727af8c80c9fe50c69bd3fe Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 12 Dec 2024 08:17:43 -0800 Subject: [PATCH 5/8] 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 8e685fa04a19febd4ab26bf772f5df1d3867ba97 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 12 Dec 2024 09:12:23 -0800 Subject: [PATCH 6/8] 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 4578299..9af9de9 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 cc7aaf99dbe33120999124937f1cc5aef5cec091 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 12 Dec 2024 12:40:23 -0800 Subject: [PATCH 7/8] bump to v2.0.0rc16 --- .github/workflows/cpp-lint-action.yml | 4 ++-- .github/workflows/cpp-lint-package.yml | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cpp-lint-action.yml b/.github/workflows/cpp-lint-action.yml index cfd75cb..5454a80 100644 --- a/.github/workflows/cpp-lint-action.yml +++ b/.github/workflows/cpp-lint-action.yml @@ -36,10 +36,10 @@ jobs: apt-get install -y libc6 cmake gcc g++ wget 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 9af9de9..aa9e11e 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -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.0rc16 - - 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 1b46fd796b6baff6a310d759991a48fd99396c9e Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Fri, 5 Jun 2026 13:46:21 -0700 Subject: [PATCH 8/8] try cpp-linter-action v3.0-rc0 branch --- .github/workflows/cpp-lint-action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cpp-lint-action.yml b/.github/workflows/cpp-lint-action.yml index 5454a80..981215e 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: