From ab58348105a234355be18244572d4cb16a7ba178 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Fri, 5 Jan 2024 21:23:50 -0800 Subject: [PATCH 1/3] prepare to test branch --- .github/workflows/cpp-lint-package.yml | 9 +++++---- src/demo.cpp | 21 +++++++++++---------- src/demo.hpp | 11 +++-------- 3 files changed, 19 insertions(+), 22 deletions(-) diff --git a/.github/workflows/cpp-lint-package.yml b/.github/workflows/cpp-lint-package.yml index 0418957..df32592 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -14,7 +14,7 @@ jobs: strategy: matrix: - clang-version: ['7', '8', '9','10', '11', '12', '13', '14', '15', '16', '17'] + clang-version: ['10', '11', '12', '13', '14', '15', '16', '17'] repo: ['cpp-linter/cpp-linter'] branch: ['${{ inputs.branch }}'] fail-fast: false @@ -62,10 +62,11 @@ jobs: -i=build -p=build -V=${{ runner.temp }}/llvm - -f=false --extra-arg="-std=c++14 -Wall" - --thread-comments=${{ matrix.clang-version == '12' }} - -a=${{ matrix.clang-version == '12' }} + --file-annotations=${{ matrix.clang-version == '16' }} + --thread-comments=${{ matrix.clang-version == '16' }} + --tidy-review=${{ matrix.clang-version == '16' }} + --format-review=${{ matrix.clang-version == '16' }} - name: Fail fast?! if: steps.linter.outputs.checks-failed > 0 diff --git a/src/demo.cpp b/src/demo.cpp index 0c1db60..1bf553e 100644 --- a/src/demo.cpp +++ b/src/demo.cpp @@ -1,17 +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() -{ - for (;;) - break; + + +int main(){ + + for (;;) break; + printf("Hello world!\n"); - return 0; -} + + + + return 0;} diff --git a/src/demo.hpp b/src/demo.hpp index 2695731..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_usefull(char *str){ - useless = str; - return 0; - } + void *not_useful(char *str){useless = str;} }; @@ -28,14 +26,11 @@ class Dummy { - - - - struct LongDiff { + long diff; }; From 321a6a0c2121c62840f635680a11d58b7e351b73 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Fri, 5 Jan 2024 21:51:19 -0800 Subject: [PATCH 2/3] prepare to test in PR --- .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 df32592..071f03e 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: @@ -16,7 +17,7 @@ jobs: matrix: clang-version: ['10', '11', '12', '13', '14', '15', '16', '17'] repo: ['cpp-linter/cpp-linter'] - branch: ['${{ inputs.branch }}'] + branch: ['pr-review-suggestions'] fail-fast: false steps: From a09a2032511f6a61f9216b24d2cd480c923d333f Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Fri, 5 Jan 2024 23:52:56 -0800 Subject: [PATCH 3/3] disable annotations; enabled lines-changed-only --- .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 071f03e..3b8c454 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -64,7 +64,8 @@ jobs: -p=build -V=${{ runner.temp }}/llvm --extra-arg="-std=c++14 -Wall" - --file-annotations=${{ matrix.clang-version == '16' }} + --file-annotations=false + --lines-changed-only=true --thread-comments=${{ matrix.clang-version == '16' }} --tidy-review=${{ matrix.clang-version == '16' }} --format-review=${{ matrix.clang-version == '16' }}