From d788f5f4ca741abe3e557fe978999a8b14d19178 Mon Sep 17 00:00:00 2001 From: Alexander Kuzmenkov <36882414+akuzm@users.noreply.github.com> Date: Thu, 24 Apr 2025 16:21:54 +0200 Subject: [PATCH] Clean up before style checks Do git reset in actions that use git diff, otherwise the errors from the previous checks get mixed into the output of the subsequent checks. --- .github/workflows/code_style.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/code_style.yaml b/.github/workflows/code_style.yaml index 27d2abd9797..928f278a983 100644 --- a/.github/workflows/code_style.yaml +++ b/.github/workflows/code_style.yaml @@ -17,10 +17,10 @@ jobs: uses: actions/checkout@v4 - name: Run format on CMake files run: | + git reset --hard find -name CMakeLists.txt -exec cmake-format -i {} + find src test tsl -name '*.cmake' -exec cmake-format -i {} + - - name: Check for diff - run: git diff --exit-code + git diff --exit-code perl_checks: name: Check Perl code in tree @@ -38,6 +38,7 @@ jobs: - name: Format Perl files, if needed if: always() run: | + git reset --hard find . -name '*.p[lm]' -exec perltidy -b -bext=/ {} + git diff --exit-code @@ -79,6 +80,7 @@ jobs: - name: Check trailing whitespace if: always() run: | + git reset --hard find . -type f -regex '.*\.\(c\|h\|sql\|sql\.in\)$' -exec perl -pi -e 's/[ \t]+$//' {} + git diff --exit-code @@ -88,6 +90,7 @@ jobs: sudo apt install clang-format-14 sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-14 100 sudo update-alternatives --set clang-format /usr/bin/clang-format-14 + git reset --hard ./scripts/clang_format_all.sh git diff --exit-code @@ -109,6 +112,7 @@ jobs: - name: Run prospector run: | + git reset --hard find . -type f -name "*.py" -print -exec prospector {} + -exec black {} + git diff --exit-code