diff --git a/.github/workflows/test-auto-fix.yml b/.github/workflows/test-auto-fix.yml new file mode 100644 index 0000000..fc3198a --- /dev/null +++ b/.github/workflows/test-auto-fix.yml @@ -0,0 +1,31 @@ +name: e2e auto-fix test + +on: + pull_request: + branches: [master] + +permissions: + contents: write + pull-requests: read + +jobs: + auto-fix: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + + - uses: cpp-linter/cpp-linter-action@test/auto-fix-e2e + id: linter + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + style: file + tidy-checks: '-*' # disable clang-tidy; test clang-format auto-fix only + files-changed-only: false + version: '18' + auto-fix: true + verbosity: debug + + - name: Report + run: | + echo "clang-format-checks-failed: ${{ steps.linter.outputs.clang-format-checks-failed }}" diff --git a/src/auto_fix_demo.cpp b/src/auto_fix_demo.cpp new file mode 100644 index 0000000..644fe2d --- /dev/null +++ b/src/auto_fix_demo.cpp @@ -0,0 +1,10 @@ +#include +int main() +{ + int x = 0; + for (int i = 0; i < 10; i++) { + x += i; + } + printf("%d", x); + return 0; +} diff --git a/src/demo.cpp b/src/demo.cpp index 0c1db60..8bbf972 100644 --- a/src/demo.cpp +++ b/src/demo.cpp @@ -1,7 +1,7 @@ /** 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; } diff --git a/src/demo.hpp b/src/demo.hpp index 2695731..5e29a02 100644 --- a/src/demo.hpp +++ b/src/demo.hpp @@ -1,41 +1,17 @@ #pragma once - - class Dummy { char* useless; int numb; - public: - void *not_usefull(char *str){ +public: + void* not_usefull(char* str) + { useless = str; return 0; } }; - - - - - - - - - - - - - - - - - - - - - -struct LongDiff -{ +struct LongDiff { long diff; - };