Add mypy
Now that we have typing in-tree. Change-Id: I58d782041fda54fd7b7089abba93f2bdae79493f Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This commit is contained in:
@@ -24,3 +24,16 @@ repos:
|
||||
- id: ruff-check
|
||||
args: ['--fix', '--unsafe-fixes']
|
||||
- id: ruff-format
|
||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||
rev: v1.17.1
|
||||
hooks:
|
||||
- id: mypy
|
||||
additional_dependencies: [
|
||||
'dogpile.cache',
|
||||
]
|
||||
# keep this in-sync with '[tool.mypy] exclude' in 'pyproject.toml'
|
||||
exclude: |
|
||||
(?x)(
|
||||
doc/.*
|
||||
| releasenotes/.*
|
||||
)
|
||||
|
@@ -69,3 +69,40 @@ ignore = [
|
||||
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
"oslo_cache/tests/*" = ["S"]
|
||||
|
||||
[tool.mypy]
|
||||
python_version = "3.10"
|
||||
show_column_numbers = true
|
||||
show_error_context = true
|
||||
ignore_missing_imports = true
|
||||
follow_imports = "normal"
|
||||
check_untyped_defs = true
|
||||
warn_unused_ignores = false
|
||||
warn_return_any = true
|
||||
warn_unused_configs = true
|
||||
warn_redundant_casts = true
|
||||
strict_equality = true
|
||||
disallow_untyped_decorators = true
|
||||
disallow_any_generics = true
|
||||
disallow_subclassing_any = true
|
||||
disallow_untyped_calls = true
|
||||
disallow_incomplete_defs = true
|
||||
disallow_untyped_defs = true
|
||||
no_implicit_reexport = true
|
||||
extra_checks = true
|
||||
# keep this in-sync with 'mypy.exclude' in '.pre-commit-config.yaml'
|
||||
exclude = '''
|
||||
(?x)(
|
||||
doc
|
||||
| releasenotes
|
||||
)
|
||||
'''
|
||||
|
||||
[[tool.mypy.overrides]]
|
||||
module = ["oslo_cache.tests.*"]
|
||||
warn_return_any = false
|
||||
disallow_untyped_decorators = false
|
||||
disallow_any_generics = false
|
||||
disallow_subclassing_any = false
|
||||
disallow_untyped_calls = false
|
||||
disallow_untyped_defs = false
|
||||
|
Reference in New Issue
Block a user