forked from udacity/CarND-Capstone
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathrun-pylint.sh
executable file
·53 lines (47 loc) · 1.31 KB
/
run-pylint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
#-------------------------------------------------------------------------------
# Author: Lukasz Janyst <[email protected]>
# Date: 19.08.2017
#-------------------------------------------------------------------------------
PACKAGES="tl_detector twist_controller waypoint_updater"
SRCDIR="ros/src"
PYLINT_FLAGS=" \
--disable=RP0001 \
--disable=RP0002 \
--disable=RP0003 \
--disable=RP0004 \
--disable=RP0101 \
--disable=RP0401 \
--disable=RP0701 \
--disable=RP0801 \
--output-format=colorized"
if [ ! -x "`which pylint 2>/dev/null`" ]; then
echo "[!] Unable to find pylint, please install it"
exit 1
fi
if [ ! -r .pylint -o ! -d ros ]; then
echo "[!] This program needs to be run from the root of the source tree"
exit 1
fi
RET=0
TOPDIR=`pwd`
for P in ${PACKAGES}; do
echo "====================================================="
echo "[i] Checking package ${P}"
DIR=${SRCDIR}/${P}
if [ ! -d ${DIR} ]; then
echo "[!] Directory ${DIR} does not exist; skipping."
continue
fi
cd ${DIR}
for FILE in `find -type f | grep py$`; do
echo "[i] Analyzing ${FILE}..."
pylint --rcfile ${TOPDIR}/.pylint ${PYLINT_FLAGS} ${FILE}
TMPRET=$?
if [ ${TMPRET} -ne 0 ]; then
RET=${TMPRET}
fi
done
cd ${TOPDIR}
done
exit ${RET}