Merge "pre-commit: Enable mypy"

This commit is contained in:
Zuul 2025-04-01 16:25:53 +00:00 committed by Gerrit Code Review
commit 4ba21fd6f4
2 changed files with 35 additions and 0 deletions

@ -26,3 +26,16 @@ repos:
- id: hacking
additional_dependencies: []
exclude: '^(doc|releasenotes)/.*$'
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.15.0
hooks:
- id: mypy
additional_dependencies:
- types-requests
# keep this in-sync with '[mypy] exclude' in 'setup.cfg'
exclude: |
(?x)(
doc/.*
| examples/.*
| releasenotes/.*
)

@ -1,3 +1,25 @@
[tool.mypy]
python_version = "3.9"
show_column_numbers = true
show_error_context = true
ignore_missing_imports = true
follow_imports = "normal"
incremental = true
check_untyped_defs = true
warn_unused_ignores = true
# keep this in-sync with 'mypy.exclude' in '.pre-commit-config.yaml'
exclude = '''
(?x)(
doc
| examples
| releasenotes
)
'''
[[tool.mypy.overrides]]
module = ["openstackclient.tests.unit.*"]
ignore_errors = true
[tool.ruff]
line-length = 79