From a9f175388fec3683119be383ad0e30359af78aac Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Tue, 24 Sep 2024 20:22:53 -0700 Subject: [PATCH 01/14] 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 6d7614b..ae29e64 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: @@ -30,7 +31,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 fd0c5100ae471b7a20a3fd50e253585467b55259 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Tue, 24 Sep 2024 20:25:43 -0700 Subject: [PATCH 02/14] pin to 2.0.0rc4 --- .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 ae29e64..e5b92c8 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -34,7 +34,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 -i https://test.pypi.org/simple/ cpp-linter==2.0.0rc4 - name: Install clang-tools run: clang-tools --install ${{ matrix.clang-version }} --directory ${{ runner.temp }}/llvm From 09938a8fc903840300c38caa52f35d3958d3a1ea Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 26 Sep 2024 11:42:40 -0700 Subject: [PATCH 03/14] build from feature 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 e5b92c8..db3f766 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -34,7 +34,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==2.0.0rc4 + python -m pip install git+https://github.com/cpp-linter/cpp_linter_rs.git@propagate-errors#subdirectory=py-binding - name: Install clang-tools run: clang-tools --install ${{ matrix.clang-version }} --directory ${{ runner.temp }}/llvm From 38a53045af5ef159d7dad4aea2fc58cd5f648be9 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 26 Sep 2024 17:43:03 -0700 Subject: [PATCH 04/14] 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 db3f766..1f428f0 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -70,6 +70,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 eae925c5f3e69b382b6a986eae1f937028094ce2 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 26 Sep 2024 18:07:34 -0700 Subject: [PATCH 05/14] add explicit permission --- .github/workflows/cpp-lint-package.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/cpp-lint-package.yml b/.github/workflows/cpp-lint-package.yml index 1f428f0..8477e55 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -12,6 +12,9 @@ on: jobs: cpp-linter: runs-on: windows-latest + permissions: + issues: write + pull-requests: write strategy: matrix: From 89b3bad21fe81a32a15da5a80ef16a6c735b22b6 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Fri, 27 Sep 2024 02:37:42 -0700 Subject: [PATCH 06/14] add contents permission to write --- .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 8477e55..10bbda2 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -15,6 +15,7 @@ jobs: permissions: issues: write pull-requests: write + contents: write strategy: matrix: From 1be32b6231c13c32f06729a97f97ba1baa339360 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Wed, 2 Oct 2024 02:31:05 -0700 Subject: [PATCH 07/14] 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 10bbda2..a78ebe9 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -38,7 +38,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 git+https://github.com/cpp-linter/cpp_linter_rs.git@propagate-errors#subdirectory=py-binding + 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 c61ad929a140a4ad054af9b8ed451c7d7c2f19c5 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Wed, 2 Oct 2024 02:38:17 -0700 Subject: [PATCH 08/14] 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 a78ebe9..46a58a2 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -63,6 +63,7 @@ jobs: id: linter env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CPP_LINTER_COLOR: true run: > cpp-linter -s=file From 574be43c9fcdef77211103fa17dd2d2e8373cf57 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Sun, 24 Nov 2024 04:01:50 -0800 Subject: [PATCH 09/14] switch to 2.0.0rc8 dist --- .github/workflows/cpp-lint-package.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cpp-lint-package.yml b/.github/workflows/cpp-lint-package.yml index 46a58a2..e30c6f7 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -38,7 +38,8 @@ 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 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.0rc8 + # 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 0b4a40f28135cb79559d943bee423594271e32f4 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Tue, 26 Nov 2024 13:50:27 -0800 Subject: [PATCH 10/14] use pre-release as action --- .github/workflows/cpp-lint-action.yml | 11 +++++++---- .github/workflows/cpp-lint-package.yml | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cpp-lint-action.yml b/.github/workflows/cpp-lint-action.yml index ce38730..c91300d 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: @@ -32,7 +33,7 @@ jobs: run: mkdir build && cmake -Bbuild src - name: Run linter as action - uses: cpp-linter/cpp-linter-action@latest + uses: cpp-linter/cpp-linter-action@v3 id: linter env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -42,10 +43,12 @@ jobs: # to ignore all build folder contents ignore: build database: build - verbosity: 9 + verbosity: debug version: ${{ matrix.clang-version }} - thread-comments: ${{ matrix.clang-version == '12' }} - file-annotations: ${{ matrix.clang-version == '12' }} + thread-comments: ${{ matrix.clang-version == '17' && 'update' }} + file-annotations: ${{ matrix.clang-version == '17' }} + tidy-review: ${{ matrix.clang-version == '17' }} + format-review: ${{ matrix.clang-version == '17' }} extra-args: -std=c++14 -Wall - name: Fail fast?! diff --git a/.github/workflows/cpp-lint-package.yml b/.github/workflows/cpp-lint-package.yml index e30c6f7..dd07f8e 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 f46a3a660e15225ef075f9a451d6fa6021423ddb Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 12 Dec 2024 07:36:25 -0800 Subject: [PATCH 11/14] switch back to v2.0.0rc11 --- .github/workflows/cpp-lint-action.yml | 2 +- .github/workflows/cpp-lint-package.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cpp-lint-action.yml b/.github/workflows/cpp-lint-action.yml index c91300d..b374735 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 dd07f8e..bdb21b9 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: @@ -38,7 +38,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==2.0.0rc8 + python -m pip install -i https://test.pypi.org/simple/ cpp-linter==2.0.0rc11 # python -m pip install git+https://github.com/cpp-linter/cpp_linter_rs.git@main#subdirectory=py-binding - name: Install clang-tools From 01bc3387085bb402635bf19c77295b632446a2cd Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 12 Dec 2024 08:17:43 -0800 Subject: [PATCH 12/14] 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 36fb3ab..d3865ad 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -183,3 +183,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 ad227b98400e148f0366550eba85aad9e99ab3fb Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 12 Dec 2024 09:12:23 -0800 Subject: [PATCH 13/14] 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 bdb21b9..d1ead22 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -72,7 +72,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 13349991a20d19df1d9792d6cea73172dc0777e8 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 12 Dec 2024 12:40:23 -0800 Subject: [PATCH 14/14] bump to v2.0.0rc12 --- .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 d1ead22..db3adcd 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -38,7 +38,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==2.0.0rc11 + python -m pip install -i https://test.pypi.org/simple/ cpp-linter==2.0.0rc12 # python -m pip install git+https://github.com/cpp-linter/cpp_linter_rs.git@main#subdirectory=py-binding - name: Install clang-tools