Skip to content

Commit 05120fd

Browse files
authored
Merge pull request #12 from pndaproject/PNDA-2180
Re-introduce pylint checking in build
2 parents b13a786 + ae17b2f commit 05120fd

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

build.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,34 @@ function error {
1010
exit -1
1111
}
1212

13+
function code_quality_error {
14+
echo "${1}"
15+
}
16+
1317
echo -n "Apache Maven 3.0.5: "
1418
if [[ $(mvn -version 2>&1) == *"Apache Maven 3.0.5"* ]]; then
1519
echo "OK"
1620
else
1721
error
1822
fi
1923

20-
mkdir -p pnda-build
21-
2224
BASE=${PWD}
2325

26+
echo -n "Code quality: "
2427
cd ${BASE}/api/src/main/resources
28+
PYLINTOUT=$(find . -type f -name '*.py' | grep -vi __init__ | xargs pylint)
29+
SCORE=$(echo ${PYLINTOUT} | grep -Po '(?<=rated at ).*?(?=/10)')
30+
echo ${SCORE}
31+
if [[ $(bc <<< "${SCORE} > 9") == 0 ]]; then
32+
code_quality_error "${PYLINTOUT}"
33+
fi
34+
2535
nosetests test_*.py
2636
[[ $? -ne 0 ]] && exit -1
2737

38+
cd ${BASE}
39+
40+
mkdir -p pnda-build
2841
cd ${BASE}/api
2942
mvn versions:set -DnewVersion=${VERSION}
3043
mvn clean package

0 commit comments

Comments
 (0)