diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index 95d29cd5a9..c1a1fa28cf 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -13,6 +13,8 @@ jobs: name: clang-tidy steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Install clang-tidy run: | sudo apt install clang-tidy @@ -25,5 +27,8 @@ jobs: cd .. - name: Check for warnings + env: + base_sha: ${{ github.event.pull_request.base.sha }} + head_sha: ${{ github.event.pull_request.head.sha }} run: | ./run-clang-tidy.sh build diff --git a/cs.c b/cs.c index 65f89b8e5b..6da1f5a589 100644 --- a/cs.c +++ b/cs.c @@ -32,6 +32,8 @@ #pragma message(CAPSTONE_MSVC_WRANING_PREFIX "Windows driver does not support full features for selected architecture(s). Define CAPSTONE_DIET to compile Capstone with only supported features. See issue #681 for details.") +// Some change + #undef CAPSTONE_MSVC_WRANING_PREFIX #undef CAPSTONE_STR #undef CAPSTONE_STR_INTERNAL diff --git a/run-clang-tidy.sh b/run-clang-tidy.sh index 02dab2722f..83ac567cf8 100755 --- a/run-clang-tidy.sh +++ b/run-clang-tidy.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -x if [ $# -ne 1 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then echo "$0 " @@ -15,8 +15,7 @@ top_level=$(git rev-parse --show-toplevel) echo "\n\n###### REPORT\n\n" -git pull origin next -changed_files=$(git diff --name-only origin/next) +changed_files=$(git diff --name-only $base_sha..$head_sha) if [ $? -ne 0 ]; then echo "Failed to get changed files." exit 1