diff --git a/.github/workflows/cpp-lint-action.yml b/.github/workflows/cpp-lint-action.yml index ce38730..b374735 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 6d7614b..bdb21b9 100644 --- a/.github/workflows/cpp-lint-package.yml +++ b/.github/workflows/cpp-lint-package.yml @@ -7,10 +7,15 @@ on: description: 'which branch to test' default: 'main' required: true + pull_request: jobs: cpp-linter: runs-on: windows-latest + permissions: + issues: write + pull-requests: write + contents: write strategy: matrix: @@ -30,7 +35,11 @@ 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==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 run: clang-tools --install ${{ matrix.clang-version }} --directory ${{ runner.temp }}/llvm @@ -55,6 +64,7 @@ jobs: id: linter env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CPP_LINTER_COLOR: true run: > cpp-linter -s=file @@ -66,6 +76,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 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; }