Pylint attempt to get a badge

This commit is contained in:
Price Hiller 2021-10-06 06:36:41 -05:00
parent 978a322e70
commit bbe1afd485

View File

@ -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."