代码拉取完成,页面将自动刷新
#!/bin/bash
set -o errexit
# When we are running on travis and *not* part of a pull request we don't
# have any upstream branch to compare against.
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
echo "Skipping since not running on travis PR"
exit 0
fi
if [ -n "$TRAVIS_BRANCH" ]; then
BRANCH=$TRAVIS_BRANCH
else
BRANCH=origin/master
fi
CLANG_DIR=$(dirname $(dirname $(which clang-tidy)))
CLANG_TIDY_DIFF=$CLANG_DIR/share/clang/clang-tidy-diff.py
TIDY_MSG=$(git diff -U0 $BRANCH... | $CLANG_TIDY_DIFF -quiet -p1 2> /dev/null)
if [ -n "$TIDY_MSG" -a "$TIDY_MSG" != "No relevant changes found." ]
then
echo "Fix clang-tidy errors before committing!"
echo
# Run clang-tidy once again to show the error
git diff -U0 $BRANCH... | $CLANG_TIDY_DIFF -quiet -p1 2> /dev/null
exit 1
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。