Skip to content

Commit ec4fd81

Browse files
committed
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>
1 parent 62c8b82 commit ec4fd81

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

.pre-commit-config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,16 @@ repos:
2626
- id: hacking
2727
additional_dependencies: []
2828
exclude: '^(doc|releasenotes)/.*$'
29+
- repo: https://github.com/pre-commit/mirrors-mypy
30+
rev: v1.15.0
31+
hooks:
32+
- id: mypy
33+
additional_dependencies:
34+
- types-requests
35+
# keep this in-sync with '[mypy] exclude' in 'setup.cfg'
36+
exclude: |
37+
(?x)(
38+
doc/.*
39+
| examples/.*
40+
| releasenotes/.*
41+
)

pyproject.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
[tool.mypy]
2+
python_version = "3.9"
3+
show_column_numbers = true
4+
show_error_context = true
5+
ignore_missing_imports = true
6+
follow_imports = "normal"
7+
incremental = true
8+
check_untyped_defs = true
9+
warn_unused_ignores = true
10+
# keep this in-sync with 'mypy.exclude' in '.pre-commit-config.yaml'
11+
exclude = '''
12+
(?x)(
13+
doc
14+
| examples
15+
| releasenotes
16+
)
17+
'''
18+
19+
[[tool.mypy.overrides]]
20+
module = ["openstackclient.tests.unit.*"]
21+
ignore_errors = true
22+
123
[tool.ruff]
224
line-length = 79
325

0 commit comments

Comments
 (0)