代码拉取完成,页面将自动刷新
#!/usr/bin/env bash
# Usage: at the root dir >> bash scripts/format.sh
# Check yapf version. (20200318 latest is 0.29.0. Format might be changed in future version.)
ver=$(yapf --version)
if ! echo $ver | grep -q 0.29.0; then
echo "Wrong YAPF version installed: 0.29.0 is required, not $ver. $YAPF_DOWNLOAD_COMMAND_MSG"
exit 1
fi
yapf --in-place --recursive -p --verbose --style .style.yapf core/
if [[ "$1" == '--test' ]]; then # Only for CI usage, user should not use --test flag.
if ! git diff --quiet &>/dev/null; then
echo '*** You have not reformatted your codes! Please run [bash format.sh] at root directory before commit! Thanks! ***'
exit 1
else
echo "Code style test passed!"
fi
fi
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。