-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_pylint
executable file
·28 lines (21 loc) · 1.21 KB
/
test_pylint
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
#!/bin/bash
# Robust way of locating script folder
# from http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in
SOURCE=${BASH_SOURCE:-$0}
DIR="$( dirname "$SOURCE" )"
while [ -h "$SOURCE" ]
do
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE"
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
export PYTHONPATH=$PYTHONPATH:$DIR/../bc_exploration/
set -e
time pylint --rcfile=pylint_rc bc_exploration
# Check certain more strict rules on non-tests and sandboxes
time pylint --rcfile=pylint_rc --disable=all --enable=protected-access,invalid-name --ignore-patterns="test_.*,tests_.*,.*_sandbox,sandbox_.*" bc_exploration
# Check documentation
pylint --rcfile=pylint_rc --disable=all --load-plugins=bc_linters.docstring_checker \
--enable=bc-missing-docstring,bc-empty-docstring,argument-after-return-docstring,return-after-return-docstring,empty-function-description-docstring,missing-argument-docstring,extra-argument-docstring,no-return-docstring,unnecessary-return-docstring,wrong-parameter-order-docstring,duplicate-argument-docstring \
--ignore-patterns="test_.*,.*_sandbox,sandbox_.*" bc_exploration