.pre-commit-pylint: auto install pylint in venv and poetry env if missing
This commit is contained in:
parent
bdbe82c3ea
commit
67125661fd
1 changed files with 2 additions and 0 deletions
|
@ -5,11 +5,13 @@ PWD=`pwd`
|
||||||
if [ -d "$PWD/venv" ]
|
if [ -d "$PWD/venv" ]
|
||||||
then
|
then
|
||||||
echo "Run pylint inside venv ($PWD/venv)..."
|
echo "Run pylint inside venv ($PWD/venv)..."
|
||||||
|
[ ! -e "$PWD/venv/bin/pylint" ] && $PWD/venv/bin/python -m pip install pylint
|
||||||
$PWD/venv/bin/pylint "$@"
|
$PWD/venv/bin/pylint "$@"
|
||||||
exit $?
|
exit $?
|
||||||
elif [ -e "$PWD/pyproject.toml" ]
|
elif [ -e "$PWD/pyproject.toml" ]
|
||||||
then
|
then
|
||||||
echo "Run pylint using poetry..."
|
echo "Run pylint using poetry..."
|
||||||
|
poetry run pylint --version > /dev/null 2>&1 || poetry run python -m pip install pylint
|
||||||
poetry run pylint "$@"
|
poetry run pylint "$@"
|
||||||
exit $?
|
exit $?
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue