diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 91f00d676..9791424cf 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -112,6 +112,23 @@ jobs: run: | source env/activate cmake --build ${{ steps.strings.outputs.build-output-dir }} -- clang-tidy + continue-on-error: true + + - name: Clang-tidy PR Comments + uses: platisd/clang-tidy-pr-comments@1b7395ce6f5a4186acabbba24cdd1e846f001aa8 + with: + # The GitHub token (or a personal access token) + github_token: ${{ secrets.GITHUB_TOKEN }} + # The path to the clang-tidy fixes generated above + clang_tidy_fixes: ${{ steps.strings.outputs.build-output-dir }}/clang-tidy-fixes.yml + # Optionally set to true if you want the Action to request + # changes in case warnings are found + request_changes: false + # Optionally set the number of comments per review + # to avoid GitHub API timeouts for heavily loaded + # pull requests + suggestions_per_comment: 10 + continue-on-error: true - name: Run Test shell: bash diff --git a/cmake/modules/LintTools.cmake b/cmake/modules/LintTools.cmake index 257f11808..28b4b2809 100644 --- a/cmake/modules/LintTools.cmake +++ b/cmake/modules/LintTools.cmake @@ -1,4 +1,4 @@ # clang-tidy setup add_custom_target(clang-tidy-filter-out-external-srcs COMMAND python3 ${TTMLIR_SOURCE_DIR}/tools/scripts/filter-compile-commands.py ${TTMLIR_BINARY_DIR}/compile_commands.json "${TTMLIR_SOURCE_DIR}") -add_custom_target(clang-tidy COMMAND run-clang-tidy.py -p ${PROJECT_BINARY_DIR} -warnings-as-errors '*' -extra-arg-before=-DDISABLE_STATIC_ASSERT_TESTS -extra-arg-before=-D__cpp_structured_bindings=202400 DEPENDS clang-tidy-filter-out-external-srcs) +add_custom_target(clang-tidy COMMAND run-clang-tidy.py -p ${PROJECT_BINARY_DIR} -export-fixes clang-tidy-fixes.yaml -warnings-as-errors '*' -extra-arg-before=-DDISABLE_STATIC_ASSERT_TESTS -extra-arg-before=-D__cpp_structured_bindings=202400 DEPENDS clang-tidy-filter-out-external-srcs) add_custom_target(clang-format COMMAND git-clang-format)