pre-commit: Enable mypy

To ease migration of various commands from OSC to SDK.

Change-Id: I4645237e8808239e4d605f7f45138449c9439949
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
Stephen Finucane 2025-02-19 20:15:44 +00:00
parent 62c8b8217e
commit ec4fd81c11
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