mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31:39 -05:00

Clean up the ci/ directory. This means getting rid of the travis/ path completely and moving the files into sensible subdirectories. Details: - Moves everything under ci/travis into subdirectories, e.g. ci/build, ci/lint, etc. - Minor adjustments to some scripts (variable renames) - Removes the outdated (unused) asan tests
22 lines
837 B
Bash
Executable file
22 lines
837 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# Compare against the master branch, because most development is done against it.
|
|
base_commit="$(git merge-base HEAD master)"
|
|
if [ "$base_commit" = "$(git rev-parse HEAD)" ]; then
|
|
# Prefix of master branch, so compare against parent commit
|
|
base_commit="$(git rev-parse HEAD^)"
|
|
echo "Running clang-format against parent commit $base_commit"
|
|
else
|
|
echo "Running clang-format against parent commit $base_commit from master branch"
|
|
fi
|
|
|
|
exclude_regex="(.*thirdparty/|.*redismodule.h|.*.java|.*.jsx?|.*.tsx?)"
|
|
output="$(ci/lint/git-clang-format --commit "$base_commit" --diff --exclude "$exclude_regex")"
|
|
if [ "$output" = "no modified files to format" ] || [ "$output" = "clang-format did not modify any files" ] ; then
|
|
echo "clang-format passed."
|
|
exit 0
|
|
else
|
|
echo "clang-format failed:"
|
|
echo "$output"
|
|
exit 1
|
|
fi
|