aboutsummaryrefslogtreecommitdiffstats
path: root/check
diff options
context:
space:
mode:
authorMartin Klozik <martin.klozik@tieto.com>2018-06-28 15:30:47 +0200
committerMartin Klozik <martin.klozik@tieto.com>2018-06-28 15:55:33 +0200
commit50f5064b274626e030f3584a17c95ef02d8f4a07 (patch)
tree45407061f54a071fa25f3253e9741b0626e3f1e4 /check
parentd45a59c342f0b12f9e9f7f5652e121868b7b270b (diff)
ci: Support for negative pylint rating
Script ./check was updated to correctly parse and process negative pylint ratings. Also awk expression was fixed to get rid of error messages during parsing of pylint output. JIRA: VSPERF-587 Change-Id: I72c5bd85f38274f308fce881517e5b6fa4a123dc Signed-off-by: Martin Klozik <martin.klozik@tieto.com> Reviewed-by: Al Morton <acmorton@att.com> Reviewed-by: Christian Trautman <ctrautma@redhat.com> Reviewed-by: Sridhar Rao <sridhar.rao@spirent.com> Reviewed-by: Richard Elias <richard.elias@tieto.com>
Diffstat (limited to 'check')
-rwxr-xr-xcheck4
1 files changed, 2 insertions, 2 deletions
diff --git a/check b/check
index 3c8c2927..b1c79ac4 100755
--- a/check
+++ b/check
@@ -159,7 +159,7 @@ if [ -s $FILE_LIST ] ; then
fi
# run pylint and extract final rating
output=`$PYLINT --rcfile $PYLINT_RC $pyfile 2>/dev/null`
- rating=`echo -e $output | tail -n3 | grep rated | sed -e 's/^.*rated at \([0-9.]*\).*$/\1/'`
+ rating=`echo -e $output | tail -n3 | grep rated | sed -e 's/^.*rated at \(-\?[0-9.]*\).*$/\1/'`
# evaluate and display aquired rating
if [ "x$rating" == "x" ] ; then
# rating is not available for files without python statements
@@ -167,7 +167,7 @@ if [ -s $FILE_LIST ] ; then
elif rating_is_ok $rating ; then
printf " %-70s ${GREEN}%-6s${BLACK}\n" $pyfile "OK"
else
- echo -e "$output" | awk '/^*+ Module|^[A-Z]\:/'
+ echo -e "$output" | awk '/^\*+ Module|^[A-Z]\:/'
printf " %-70s ${RED}%-6s${BLACK}\n" $pyfile $rating
fi
done