File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -10,21 +10,34 @@ function error {
10
10
exit -1
11
11
}
12
12
13
+ function code_quality_error {
14
+ echo " ${1} "
15
+ }
16
+
13
17
echo -n " Apache Maven 3.0.5: "
14
18
if [[ $( mvn -version 2>&1 ) == * " Apache Maven 3.0.5" * ]]; then
15
19
echo " OK"
16
20
else
17
21
error
18
22
fi
19
23
20
- mkdir -p pnda-build
21
-
22
24
BASE=${PWD}
23
25
26
+ echo -n " Code quality: "
24
27
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
+
25
35
nosetests test_* .py
26
36
[[ $? -ne 0 ]] && exit -1
27
37
38
+ cd ${BASE}
39
+
40
+ mkdir -p pnda-build
28
41
cd ${BASE} /api
29
42
mvn versions:set -DnewVersion=${VERSION}
30
43
mvn clean package
You can’t perform that action at this time.
0 commit comments