diff options
| author | Camil Staps | 2016-05-03 14:37:33 +0200 | 
|---|---|---|
| committer | Camil Staps | 2016-11-30 19:11:42 +0100 | 
| commit | 59685d7c62bb0bed3cf97f09cb6ac3f6bf56ee32 (patch) | |
| tree | c63dc40246b9ed2e40be0c3e5d6f1ed17764d2f8 /bin | |
| parent | Fix vim for tex (diff) | |
PyLint to recognise py3/py2 based on shebang
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/pylint.sh | 19 | 
1 files changed, 19 insertions, 0 deletions
| diff --git a/bin/pylint.sh b/bin/pylint.sh new file mode 100755 index 0000000..28087c7 --- /dev/null +++ b/bin/pylint.sh @@ -0,0 +1,19 @@ +#!/bin/bash +PYMAJOR=$1 + +if [ "$1" = "--version" ] +then +	pylint --version +	return +fi + +if [ "$PYMAJOR" <> "2" ] && [ "$PYMAJOR" <> "3" ] +then +	PYMAJOR=2 +	grep '#!.*python3' "${@: -1}" >/dev/null && PYMAJOR=3 +fi + +echo "Using python$PYMAJOR" + +/usr/bin/env "python$PYMAJOR" -m pylint "${@:2}" + | 
