diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 14bfc2b85f..a8382cf11b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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/.* + ) diff --git a/pyproject.toml b/pyproject.toml index 9a30d5bc50..2a532cef68 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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