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/.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 25f3bf7..eccf6a6 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: @@ -15,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: @@ -30,7 +31,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 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 @@ -55,6 +60,7 @@ jobs: id: linter env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CPP_LINTER_COLOR: true run: > cpp-linter -s=file @@ -62,10 +68,12 @@ 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' }} + --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..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; };