SWDEV-123456 - use only specific lines (#573)
* SWDEV-123456 - use only specific lines * SWDEV-123456 - only run clang on diff between PR target and current
This commit is contained in:
committed by
GitHub
orang tua
4c2405b108
melakukan
ccb31fdf9d
@@ -36,4 +36,21 @@ if ! command -v "$clang_bin" >/dev/null 2>&1; then
|
||||
fi
|
||||
fi
|
||||
|
||||
"$clang_bin" -style=file --dry-run -fallback-style=none -n -Werror $files
|
||||
clang_format_diff="${CLANG_FORMAT_DIFF:-clang-format-diff}"
|
||||
if ! command -v "$clang_format_diff" >/dev/null 2>&1; then
|
||||
if [[ -x "/c/Program Files/LLVM/share/clang/clang-format-diff.py" ]]; then
|
||||
clang_format_diff="/c/Program Files/LLVM/share/clang/clang-format-diff.py"
|
||||
fi
|
||||
fi
|
||||
|
||||
for file in $files; do
|
||||
echo "Checking lines of $file"
|
||||
|
||||
if [[ -n $RANGE ]]; then
|
||||
diff_output=$(git diff -U0 "$RANGE" -- "$file")
|
||||
else
|
||||
diff_output=$(git diff -U0 --cached -- "$file")
|
||||
fi
|
||||
|
||||
echo "$diff_output" | "$clang_format_diff" -style=file -fallback-style=none -p1
|
||||
done
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
name: Clang format check
|
||||
|
||||
name: Clang format check
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
types: [synchronize, opened]
|
||||
|
||||
jobs:
|
||||
format:
|
||||
@@ -19,4 +19,4 @@ jobs:
|
||||
id: clang-format
|
||||
run: |
|
||||
chmod +x .github/hooks/clang-format-check.sh
|
||||
./.github/hooks/clang-format-check.sh --range "${{ github.event.before }}..${{ github.sha }}"
|
||||
./.github/hooks/clang-format-check.sh --range "${{ github.event.pull_request.base.sha }}..${{ github.sha }}"
|
||||
|
||||
@@ -42,7 +42,7 @@ RUNTIME_ENTRY(cl_int, clGetDeviceIDsFromDX9MediaAdapterKHR,
|
||||
static const bool VALIDATE_ONLY = true;
|
||||
|
||||
if (platform != NULL && platform != AMD_PLATFORM) {
|
||||
LogWarning("\"platrform\" is not a valid AMD platform");
|
||||
LogWarning("\"platform\" is not a valid AMD platform");
|
||||
return CL_INVALID_PLATFORM;
|
||||
}
|
||||
// check if input parameter are correct
|
||||
|
||||
Reference in New Issue
Block a user