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
|
DOCKER_DRIVER: overlay2
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
|
- test
|
||||||
- deploy
|
- 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:
|
build_and_push_container:
|
||||||
stage: deploy
|
stage: deploy
|
||||||
script:
|
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():
|
def get_red_panda():
|
||||||
red_panda = None
|
red_panda = None
|
||||||
while not red_panda:
|
while not red_panda:
|
||||||
red_panda = requests.get("https://some-random-api.ml/img/red_panda").json()[
|
red_panda = requests.get("https://some-random-api.ml/img/red_panda").json()["link"]
|
||||||
"link"
|
|
||||||
]
|
|
||||||
return red_panda
|
return red_panda
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user