1 Star 0 Fork 0

SunnyQjm/binaryen

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
clang-tidy-diff.sh 796 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/quejianming/binaryen.git
git@gitee.com:quejianming/binaryen.git
quejianming
binaryen
binaryen
master

搜索帮助