🎨 Prepare linters environment once
Some checks failed
ci/woodpecker/pr/lint Pipeline failed

This commit is contained in:
2024-02-14 22:49:55 +01:00
parent d4d24d13d2
commit 001c7330c6

View File

@@ -7,24 +7,28 @@ steps:
- name: prepare - name: prepare
image: python:3.12-alpine image: python:3.12-alpine
commands: | commands: |
python3 -m venv local
source ./local/bin/activate
export PATH="./local/bin:${PATH}"
cd ./local
wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh | sh -s latest
pip install poetry
poetry install --only=linters --no-root
- name: ruff - name: ruff
image: python:3.12-alpine image: python:3.12-alpine
failure: ignore failure: ignore
secrets: ["reviewdog_gitea_api_token", "gitea_address"] secrets: ["reviewdog_gitea_api_token", "gitea_address"]
commands: | commands: |
pip install poetry export PATH="./local/bin:${PATH}"
cd backend cd backend
poetry install --only=linters --no-root poetry run ruff --output-format sarif . | reviewdog -f sarif -reporter gitea-pr-review -filter-mode nofilter
poetry run ruff --output-format sarif . | ../bin/reviewdog -f sarif -reporter gitea-pr-review -filter-mode nofilter
- name: mypy - name: mypy
image: python:3.12-alpine image: python:3.12-alpine
failure: ignore failure: ignore
secrets: ["reviewdog_gitea_api_token", "gitea_address"] secrets: ["reviewdog_gitea_api_token", "gitea_address"]
commands: | commands: |
pip install poetry export PATH="./local/bin:${PATH}"
cd backend cd backend
poetry install --only=linters --no-root poetry run mypy --no-incremental . | reviewdog -f mypy -reporter gitea-pr-review -filter-mode nofilter
poetry run mypy --no-incremental . | ../bin/reviewdog -f mypy -reporter gitea-pr-review -filter-mode nofilter