Adding a lint phase to the ci/cd pipeline. This should fail because animals.py is not formatted properly according to black
This commit is contained in:
parent
ca49a70cc7
commit
6244e5567e
@ -9,8 +9,18 @@ variables:
|
||||
DOCKER_DRIVER: overlay2
|
||||
|
||||
stages:
|
||||
- test
|
||||
- deploy
|
||||
|
||||
|
||||
lint_python_on_merge_request:
|
||||
image: python:alpine
|
||||
stage: test
|
||||
script:
|
||||
- echo "Linting Python code"
|
||||
- pip install black && black --fast --check .
|
||||
|
||||
|
||||
build_and_push_container:
|
||||
stage: deploy
|
||||
script:
|
||||
|
4
app/animals.py
Executable file → Normal file
4
app/animals.py
Executable file → Normal file
@ -9,9 +9,7 @@ import get_from_reddit
|
||||
def get_red_panda():
|
||||
red_panda = None
|
||||
while not red_panda:
|
||||
red_panda = requests.get("https://some-random-api.ml/img/red_panda").json()[
|
||||
"link"
|
||||
]
|
||||
red_panda = requests.get("https://some-random-api.ml/img/red_panda").json()["link"]
|
||||
return red_panda
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user