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-package.yml b/.github/workflows/cpp-lint-package.yml index 25f3bf7..832dc99 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: 'hide-reuse-pr-reviews' required: true + pull_request: jobs: cpp-linter: @@ -16,7 +17,8 @@ jobs: matrix: clang-version: ['9','10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20'] repo: ['cpp-linter/cpp-linter'] - branch: ['${{ inputs.branch }}'] + branch: + - ${{ github.event_name == 'workflow_dispatch' && inputs.branch || 'hide-reuse-pr-reviews' }} fail-fast: false steps: @@ -66,6 +68,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..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; };