From c122785dbabd5a826a066cc00fef79acdb526715 Mon Sep 17 00:00:00 2001 From: "Sidorov, Dmitry" Date: Thu, 16 Nov 2023 01:41:36 -0800 Subject: [PATCH] [CI] Test clang-tidy in CI Signed-off-by: Sidorov, Dmitry --- .github/workflows/check-code-style.yml | 36 +------------------------- lib/SPIRV/SPIRVToLLVMDbgTran.cpp | 2 +- 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/.github/workflows/check-code-style.yml b/.github/workflows/check-code-style.yml index 198f160e66..0ff38a390d 100644 --- a/.github/workflows/check-code-style.yml +++ b/.github/workflows/check-code-style.yml @@ -96,41 +96,7 @@ jobs: run: | cat diff-to-inspect.txt | /usr/lib/llvm-${{ env.LLVM_VERSION }}/share/clang/clang-tidy-diff.py \ -p1 -clang-tidy-binary clang-tidy-${{ env.LLVM_VERSION }} -quiet \ - -path ${{ github.workspace}}/build > clang-tidy.log 2>/dev/null - # By some reason, clang-tidy log contains tons of extra empty lines, - # that confuse the check below - sed -i '/^$/d' clang-tidy.log - if [ -s clang-tidy.log ]; then - if ! grep -q "No relevant changes found." clang-tidy.log; then - # Emit annotations - while read -r line; do - type="error" - if [[ $line == *"warning:"* ]]; then - type="warning" - elif [[ $line == *"error:"* ]]; then - type="error" - else - continue - fi - - absolute_path=$(echo $line | grep -Po "^[\w\d-./]+(?=:)") - relative_path=${absolute_path##"${{ github.workspace }}"} - - line_number=$(echo $line | grep -Po "(?<=:)\d+(?=:\d)") - - message=$(echo $line | grep -Po "(?<=${type}: ).*$") - - # see [workflow-commands] for documentation - echo "::${type} file=${relative_path},line=${line_number}::${message}" - done < clang-tidy.log - - echo "clang-tidy found incorrectly written code:" - cat clang-tidy.log - exit 1 - else - rm clang-tidy.log # to avoid uploading empty file - fi - fi + -path ${{ github.workspace}}/build - name: Upload patch with clang-format fixes uses: actions/upload-artifact@v2 diff --git a/lib/SPIRV/SPIRVToLLVMDbgTran.cpp b/lib/SPIRV/SPIRVToLLVMDbgTran.cpp index c616d5df90..75747549f7 100644 --- a/lib/SPIRV/SPIRVToLLVMDbgTran.cpp +++ b/lib/SPIRV/SPIRVToLLVMDbgTran.cpp @@ -802,7 +802,7 @@ DINode *SPIRVToLLVMDbgTran::transTypeEnum(const SPIRVExtInst *DebugInst) { UnderlyingType = transDebugInst(static_cast(E)); return getDIBuilder(DebugInst).createEnumerationType( Scope, Name, File, LineNo, SizeInBits, AlignInBits, Enumerators, - UnderlyingType, "", UnderlyingType); + UnderlyingType, 0, "", UnderlyingType); } }