2024-02-13 13:08:46 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
PWD=`pwd`
|
|
|
|
|
|
|
|
if [ -d "$PWD/venv" ]
|
|
|
|
then
|
|
|
|
echo "Run pylint inside venv ($PWD/venv)..."
|
2024-02-13 13:41:35 +01:00
|
|
|
[ ! -e "$PWD/venv/bin/pylint" ] && $PWD/venv/bin/python -m pip install pylint
|
2024-02-13 13:08:46 +01:00
|
|
|
$PWD/venv/bin/pylint "$@"
|
|
|
|
exit $?
|
|
|
|
elif [ -e "$PWD/pyproject.toml" ]
|
|
|
|
then
|
|
|
|
echo "Run pylint using poetry..."
|
2024-02-13 13:41:35 +01:00
|
|
|
poetry run pylint --version > /dev/null 2>&1 || poetry run python -m pip install pylint
|
2024-02-13 13:08:46 +01:00
|
|
|
poetry run pylint "$@"
|
|
|
|
exit $?
|
|
|
|
else
|
|
|
|
echo "Run pylint at system scope..."
|
|
|
|
pylint "$@"
|
|
|
|
exit $?
|
|
|
|
fi
|