mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-06-13 19:21:32 +03:00
Change the use of pylint to optionally use pylint3
Pylint when installed as a distro package can be installed as pylint3, whilst as a PEP egg, it can be installed as pylint. This commit changes the scripts to first use pylint if installed, and optionally look for pylint3 if not installed. This is to allow a preference for the PEP version over the distro version, assuming the PEP one is more likely to be the correct one. Signed-off-by: Simon Butcher <simon.butcher@arm.com>
This commit is contained in:
@ -9,4 +9,15 @@
|
||||
# Run 'pylint' on Python files for programming errors and helps enforcing
|
||||
# PEP8 coding standards.
|
||||
|
||||
pylint3 -j 2 scripts/*.py tests/scripts/*.py
|
||||
# Find the installed version of Pylint. Installed as a distro package this can
|
||||
# be pylint3 and as a PEP egg, pylint. We prefer pylint over pylint3
|
||||
if type pylint >/dev/null 2>/dev/null; then
|
||||
PYLINT=pylint
|
||||
elif type pylint3 >/dev/null 2>/dev/null; then
|
||||
PYLINT=pylint3
|
||||
else
|
||||
echo 'Pylint was not found.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$PYLINT -j 2 scripts/*.py tests/scripts/*.py
|
||||
|
Reference in New Issue
Block a user