2 Star 6 Fork 4

monkey_cici/cvat

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
format_python_code.sh 936 Bytes
一键复制 编辑 原始数据 按行查看 历史
Roman Donchenko 提交于 2025-01-22 20:18 +08:00 . Simplify the code formatting script (#8910)
#! /bin/env bash
set -e
REPO_ROOT="$(dirname "$0")/.."
PYTHON="${PYTHON:-python3}"
BLACK="${PYTHON} -m black"
ISORT="${PYTHON} -m isort"
if ! ${BLACK} --version >/dev/null 2>&1; then
echo "black is not found, please check it is installed"
exit 1
fi
if ! ${ISORT} --version >/dev/null 2>&1; then
echo "isort is not found, please check it is installed"
exit 1
fi
cd -- "${REPO_ROOT}"
${BLACK} .
# isort is slow at skipping large Git-ignored directories when invoked as `isort .`,
# so pass it an explicit list of files instead.
# isort will only skip files listed in the config file corresponding to the first file
# on the command line, which would normally be cvat-cli/pyproject.toml. Force the first
# file to be manage.py, so that it uses `pyproject.toml` instead.
git ls-files -z --exclude-standard --deduplicate --cached --others '*.py' \
| xargs -0 ${ISORT} --resolve-all-configs --filter-files manage.py
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/monkeycc/cvat.git
git@gitee.com:monkeycc/cvat.git
monkeycc
cvat
cvat
develop

搜索帮助