10 Star 61 Fork 22

OpenDILab开源决策智能平台 / DI-engine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
format.sh 716 Bytes
一键复制 编辑 原始数据 按行查看 历史
niuyazhe 提交于 2021-07-08 13:56 . v0.1.0
#!/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 $1
if [[ "$2" == '--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
Python
1
https://gitee.com/opendilab/DI-engine.git
git@gitee.com:opendilab/DI-engine.git
opendilab
DI-engine
DI-engine
main

搜索帮助