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
|
||||||
.mypy_cache*
|
.mypy_cache*
|
||||||
.dmypy.json
|
.dmypy.json
|
||||||
|
mypy/
|
||||||
|
mypy-out.txt
|
||||||
|
|
||||||
# C extensions
|
# C extensions
|
||||||
*.so
|
*.so
|
||||||
|
|
|
||||||
|
|
@ -95,12 +95,15 @@ mypy:
|
||||||
extends: .python
|
extends: .python
|
||||||
script:
|
script:
|
||||||
- mkdir -p mypy
|
- 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
|
||||||
- mypy src --cobertura-xml-report mypy --no-error-summary > mypy-out.txt || true
|
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
|
- mypy-gitlab-code-quality < mypy-out.txt > codequality.json
|
||||||
allow_failure: true
|
- cat mypy-out.txt
|
||||||
|
|
||||||
artifacts:
|
artifacts:
|
||||||
|
when: always
|
||||||
reports:
|
reports:
|
||||||
codequality: codequality.json
|
codequality: codequality.json
|
||||||
coverage_report:
|
coverage_report:
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ dependencies = [
|
||||||
dev = [
|
dev = [
|
||||||
"ruff~=0.13.0",
|
"ruff~=0.13.0",
|
||||||
"mypy[reports]",
|
"mypy[reports]",
|
||||||
"mypy-gitlab-code-quality",
|
|
||||||
# "pytest-gitlab-code-quality", # pytest version constraint clashes with labthings
|
# "pytest-gitlab-code-quality", # pytest version constraint clashes with labthings
|
||||||
"pytest",
|
"pytest",
|
||||||
"pytest-cov",
|
"pytest-cov",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue