Update CI to fail if MyPy fails but to still give code quality report
This commit is contained in:
parent
c1ad445517
commit
5d25067a21
3 changed files with 8 additions and 4 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -10,6 +10,8 @@ __pycache__/
|
|||
# Mypy cache
|
||||
.mypy_cache*
|
||||
.dmypy.json
|
||||
mypy/
|
||||
mypy-out.txt
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue