From 9b939e51e7fa49ea92917fc3b889ae4a6383c1da Mon Sep 17 00:00:00 2001 From: Richard Feistenauer Date: Sun, 25 Oct 2020 20:03:46 +0000 Subject: [PATCH] Adds pylint_badge --- .gitlab-ci.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3b4f4c2..d5c61d4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,7 +11,14 @@ stages: pylint: stage: Static Analysis script: - - pylint -d C0301 cellular_automaton/*.py + - mkdir ./pylint + - pylint --output-format=text -d C0301 cellular_automaton/*.py | tee ./pylint/pylint.log || pylint-exit $? + - PYLINT_SCORE=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' ./pylint/pylint.log) + - anybadge --label=Pylint --file=pylint/pylint.svg --value=$PYLINT_SCORE 2=red 4=orange 8=yellow 10=green + - echo "Pylint score is $PYLINT_SCORE" + artifacts: + paths: + - ./pylint/ test: stage: Test