From 07ba84f1fb47234d9f838c0f6a3e516e1ee01c40 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 12 Dec 2024 08:00:53 -0800 Subject: [PATCH 1/4] switch to dev branch --- .github/workflows/cpp-lint-action.yml | 14 +++++++------- .github/workflows/cpp-lint-package.yml | 13 ++++++++++--- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cpp-lint-action.yml b/.github/workflows/cpp-lint-action.yml index ce38730..7c6ca7a 100644 --- a/.github/workflows/cpp-lint-action.yml +++ b/.github/workflows/cpp-lint-action.yml @@ -32,7 +32,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@main id: linter env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -42,17 +42,17 @@ 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 == '16' }} + file-annotations: ${{ matrix.clang-version == '16' }} extra-args: -std=c++14 -Wall - name: Fail fast?! # if: steps.linter.outputs.checks-failed > 0 run: | - echo "some linter checks failed" - echo "${{ steps.linter.outputs.checks-failed }}" - echo "${{ env.checks-failed }}" + echo "checks-failed: ${{ steps.linter.outputs.checks-failed }}" + echo "clang-tidy-checks-failed: ${{ steps.linter.outputs.clang-tidy-checks-failed }}" + echo "clang-format-checks-failed: ${{ steps.linter.outputs.clang-format-checks-failed }}" # for actual deployment # run: exit 1 diff --git a/.github/workflows/cpp-lint-package.yml b/.github/workflows/cpp-lint-package.yml index 6d7614b..18b133e 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -5,8 +5,9 @@ on: inputs: branch: description: 'which branch to test' - default: 'main' + default: 'fix-test-coverage' required: true + pull_request: jobs: cpp-linter: @@ -16,7 +17,8 @@ jobs: matrix: clang-version: ['7', '8', '9','10', '11', '12', '13', '14', '15', '16', '17'] repo: ['cpp-linter/cpp-linter'] - branch: ['${{ inputs.branch }}'] + branch: + - ${{ github.event_name == 'workflow_dispatch' && inputs.branch || 'fix-test-coverage' }} fail-fast: false steps: @@ -66,9 +68,14 @@ 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 - run: echo "Some files failed the linting checks!" + run: | + echo "checks-failed: ${{ steps.linter.outputs.checks-failed }}" + echo "clang-tidy-checks-failed: ${{ steps.linter.outputs.clang-tidy-checks-failed }}" + echo "clang-format-checks-failed: ${{ steps.linter.outputs.clang-format-checks-failed }}" # for actual deployment # run: exit 1 From d6831a093b4a6f828e49573e8b048729841cd5c7 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 12 Dec 2024 08:03:14 -0800 Subject: [PATCH 2/4] update lang configs --- .clang-format | 2 +- .clang-tidy | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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: '' +... From 01e2ebf010b949986fa3e6d6e81e7f7c8da90001 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 12 Dec 2024 08:04:15 -0800 Subject: [PATCH 3/4] make source changes --- src/demo.cpp | 21 +++++++++++---------- src/demo.hpp | 11 +++-------- 2 files changed, 14 insertions(+), 18 deletions(-) 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 88d5db6fb3a450f2598e297cbd6ad83b0c584f02 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Thu, 12 Dec 2024 12:05:51 -0800 Subject: [PATCH 4/4] switch branches --- .github/workflows/cpp-lint-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cpp-lint-package.yml b/.github/workflows/cpp-lint-package.yml index 18b133e..3651db9 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -5,7 +5,7 @@ on: inputs: branch: description: 'which branch to test' - default: 'fix-test-coverage' + default: 'hide-reuse-pr-reviews' required: true pull_request: @@ -18,7 +18,7 @@ jobs: clang-version: ['7', '8', '9','10', '11', '12', '13', '14', '15', '16', '17'] repo: ['cpp-linter/cpp-linter'] branch: - - ${{ github.event_name == 'workflow_dispatch' && inputs.branch || 'fix-test-coverage' }} + - ${{ github.event_name == 'workflow_dispatch' && inputs.branch || 'hide-reuse-pr-reviews' }} fail-fast: false steps: