1 Star 1 Fork 1

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

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
format.sh 717 Bytes
一键复制 编辑 原始数据 按行查看 历史
robinc94 提交于 2021-07-08 04:32 +08:00 . init commit
#!/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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/opendilab/DI-drive.git
git@gitee.com:opendilab/DI-drive.git
opendilab
DI-drive
DI-drive
main

搜索帮助