From bbe1afd4855668a906877971765671ee0f1f56b8 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Wed, 6 Oct 2021 06:36:41 -0500 Subject: [PATCH] Pylint attempt to get a badge --- .gitlab-ci.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0ee162d..7ac7e4b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,12 +27,16 @@ build-job: # This job runs in the build stage, which runs first. # - echo "Code coverage is 90%" lint-test-job: # This job also runs in the test stage. - stage: test # It can run at the same time as unit-test-job (in parallel). + stage: test + before_script: + - pip install pylint pylint-exit anybadge script: - - python -m pylint asyncdb + - mkdir ./pylint + - pylint --output-format=text . | 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/ -deploy-job: # This job runs in the deploy stage. - stage: deploy # It only runs when *both* jobs in the test stage complete successfully. - script: - - echo "Deploying application..." - - echo "Application successfully deployed."