5 Star 12 Fork 18

lins05/seahub

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
code-check.sh 1012 Bytes
一键复制 编辑 原始数据 按行查看 历史
#!/bin/bash
#
#
#
function usage() {
echo
echo " Seahub project code checker."
echo
echo " It runs pylint on the code and prints the result."
echo
echo " To check a file:"
echo
echo " ./code-check.sh seahub.views.file"
echo
echo " To check a module:"
echo
echo " ./code-check.sh seahub.views"
echo
}
if [[ $# == 0 ]]; then
usage;
exit 1
fi
if [[ $# == 1 ]]; then
if [[ $1 == "-h" || $1 == "--help" ]]; then
usage;
exit 1
fi
fi
SCRIPT=$(readlink -f "$0")
PROJECT_DIR=$(dirname "${SCRIPT}")
cd ${PROJECT_DIR}
if ! which pylint 2>/dev/null 1>&2; then
echo
echo "Pylint not found. Please install it first by:"
echo
echo " sudo pip install pylint"
echo
exit 1
fi
pylintrc=${PROJECT_DIR}/pylintrc
if ! [[ -f ${pylintrc} ]]; then
echo "${pylintrc} not found"
echo
echo "mv pylintrc.template pylintrc"
echo
exit 1
fi
pylint --rcfile=${pylintrc} -E $@
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/lins05/seahub.git
[email protected]:lins05/seahub.git
lins05
seahub
seahub
master

搜索帮助