]> arthur.barton.de Git - bup.git/blob - pylint
Drop support for python 2
[bup.git] / pylint
1 #!/usr/bin/env bash
2
3 # Changes here might also be appropriate for ./pytest
4
5 set -eu
6
7 with_pylint=$(cat config/config.var/with-pylint)
8
9 case "$with_pylint" in
10     yes) ;;
11     no)
12         echo "./pylint: doing nothing given ./configure --with-pylint=no" 1>&2
13         exit 0
14         ;;
15     maybe)
16         rc=0
17         dev/have-pylint || rc=$?
18         case "$rc" in
19             0) ;;
20             1)
21                 echo "./pylint: doing nothing (pylint not found)" 1>&2
22                 exit 0
23                 ;;
24             *) exit "$rc" ;;
25         esac
26         ;;
27     *)
28         printf "./pylint: unexpected config/config.var/with-pylint value %q\n" \
29                "$with_pylint" 1>&2
30         exit 2
31         ;;
32 esac
33
34 script_home="$(cd "$(dirname "$0")" && pwd -P)"
35 testlibdir="$script_home/test/lib"
36
37 export PYTHONPATH="$testlibdir${PYTHONPATH:+:$PYTHONPATH}"
38
39 if test "$#" -eq 0; then
40     set -x
41     dev/bup-python -m pylint lib
42     # unused-wildcard-import: we always "import * from wvpytest"
43     dev/bup-python -m pylint -d unused-wildcard-import test/lib test/int
44 else
45     set -x
46     exec dev/bup-python -m pylint "$@"
47 fi