Skip to content

Commit

Permalink
[CI] Test clang-tidy in CI
Browse files Browse the repository at this point in the history
Signed-off-by: Sidorov, Dmitry <dmitry.sidorov@intel.com>
  • Loading branch information
MrSidims committed Nov 16, 2023
1 parent 52cc84e commit c122785
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 36 deletions.
36 changes: 1 addition & 35 deletions .github/workflows/check-code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/SPIRV/SPIRVToLLVMDbgTran.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,7 @@ DINode *SPIRVToLLVMDbgTran::transTypeEnum(const SPIRVExtInst *DebugInst) {
UnderlyingType = transDebugInst<DIType>(static_cast<SPIRVExtInst *>(E));
return getDIBuilder(DebugInst).createEnumerationType(
Scope, Name, File, LineNo, SizeInBits, AlignInBits, Enumerators,
UnderlyingType, "", UnderlyingType);
UnderlyingType, 0, "", UnderlyingType);
}
}

Expand Down

0 comments on commit c122785

Please sign in to comment.