From 359c49924ffe3e3ecf572887a02c022a7d007498 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Tue, 24 Sep 2024 20:22:53 -0700 Subject: [PATCH 1/7] 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 25f3bf7..7c42fb5 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 5244d1b4dc50fba6780c62265e24e106c0522ff4 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 26 Sep 2024 17:43:03 -0700 Subject: [PATCH 2/7] 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 7c42fb5..ae5dbed 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 ebf8697fbdd230bf39d915980657ab506178900f Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Wed, 2 Oct 2024 02:31:05 -0700 Subject: [PATCH 3/7] 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 ae5dbed..a4d73e7 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 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 c54186bb2e870bfc4f392c560888701dbf6664ed Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Wed, 2 Oct 2024 02:38:17 -0700 Subject: [PATCH 4/7] 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 a4d73e7..0a4e52a 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -59,6 +59,7 @@ jobs: id: linter env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CPP_LINTER_COLOR: true run: > cpp-linter -s=file From ab83618bb68b388c1e88034fdab96b41b93b96db Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 12 Dec 2024 08:17:43 -0800 Subject: [PATCH 5/7] 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 a44db76532cff7169a9feca7178fef1d6c3b380a Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 12 Dec 2024 09:12:23 -0800 Subject: [PATCH 6/7] 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 0a4e52a..0607315 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -67,7 +67,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 37b2c4e66e8253c78a9765b646f3a5cbd73a5d37 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 12 Dec 2024 12:40:23 -0800 Subject: [PATCH 7/7] bump to v2.0.0rc12 update CI rm subdir param to pip install --- .github/workflows/cpp-lint-action.yml | 4 ++-- .github/workflows/cpp-lint-package.yml | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cpp-lint-action.yml b/.github/workflows/cpp-lint-action.yml index 31d72e0..d95d1c7 100644 --- a/.github/workflows/cpp-lint-action.yml +++ b/.github/workflows/cpp-lint-action.yml @@ -35,10 +35,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 0607315..eccf6a6 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -16,8 +16,8 @@ jobs: strategy: matrix: clang-version: ['9','10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20'] - repo: ['cpp-linter/cpp-linter'] - branch: ['${{ inputs.branch }}'] + repo: ['cpp-linter/cpp-linter-rs'] + branch: ['hide-reuse-reviews'] # ['${{ inputs.branch }}'] fail-fast: false steps: @@ -34,7 +34,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 git+https://github.com/${{ matrix.repo }}.git@${{ matrix.branch }} + # python -m pip install -i https://test.pypi.org/simple/ cpp-linter==2.0.0rc12 - name: Install clang-tools run: clang-tools --install ${{ matrix.clang-version }} --directory ${{ runner.temp }}/llvm