Update CI to fail if MyPy fails but to still give code quality report

This commit is contained in:
Julian Stirling 2025-12-19 17:04:18 +00:00
parent c1ad445517
commit 5d25067a21
3 changed files with 8 additions and 4 deletions

2
.gitignore vendored
View file

@ -10,6 +10,8 @@ __pycache__/
# Mypy cache
.mypy_cache*
.dmypy.json
mypy/
mypy-out.txt
# C extensions
*.so

View file

@ -95,12 +95,15 @@ mypy:
extends: .python
script:
- mkdir -p mypy
# "|| true" is used for preventing job failure when mypy find errors
- mypy src --cobertura-xml-report mypy --no-error-summary > mypy-out.txt || true
- mypy src --cobertura-xml-report mypy --no-error-summary > mypy-out.txt
after_script:
# Installed here rather than with [dev] as the after_script runs in a new shell
- pip install mypy-gitlab-code-quality
- mypy-gitlab-code-quality < mypy-out.txt > codequality.json
allow_failure: true
- cat mypy-out.txt
artifacts:
when: always
reports:
codequality: codequality.json
coverage_report:

View file

@ -37,7 +37,6 @@ dependencies = [
dev = [
"ruff~=0.13.0",
"mypy[reports]",
"mypy-gitlab-code-quality",
# "pytest-gitlab-code-quality", # pytest version constraint clashes with labthings
"pytest",
"pytest-cov",