.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" ]
|
||||
then
|
||||
echo "Run pylint inside venv ($PWD/venv)..."
|
||||
[ ! -e "$PWD/venv/bin/pylint" ] && $PWD/venv/bin/python -m pip install pylint
|
||||
$PWD/venv/bin/pylint "$@"
|
||||
exit $?
|
||||
elif [ -e "$PWD/pyproject.toml" ]
|
||||
then
|
||||
echo "Run pylint using poetry..."
|
||||
poetry run pylint --version > /dev/null 2>&1 || poetry run python -m pip install pylint
|
||||
poetry run pylint "$@"
|
||||
exit $?
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue