Skip to content

Commit

Permalink
🧪 Disallow expressions returning Any type
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz committed Oct 4, 2024
1 parent 7324ee9 commit 8ea0766
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 2 deletions.
48 changes: 47 additions & 1 deletion .mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ files =
check_untyped_defs = true

disallow_any_explicit = true
# disallow_any_expr = true # crashes with some decorators like `@functools.cache` and `@pytest.mark.parametrize`
disallow_any_expr = true
disallow_any_decorated = true
disallow_any_generics = true
disallow_any_unimported = true
Expand Down Expand Up @@ -57,6 +57,52 @@ warn_return_any = true
warn_unused_configs = true
warn_unused_ignores = true

[mypy-awx_plugins.credentials.aim]
# crashes with some decorators like `@functools.cache`:
disallow_any_expr = false

[mypy-awx_plugins.credentials.aws_secretsmanager]
# crashes with some decorators like `@functools.cache`:
disallow_any_expr = false

[mypy-awx_plugins.credentials.azure_kv]
# crashes with some decorators like `@functools.cache`:
disallow_any_expr = false

[mypy-awx_plugins.credentials.centrify_vault]
# crashes with some decorators like `@functools.cache`:
disallow_any_expr = false

[mypy-awx_plugins.credentials.conjur]
# crashes with some decorators like `@functools.cache`:
disallow_any_expr = false

[mypy-awx_plugins.credentials.dsv]
# crashes with some decorators like `@functools.cache`:
disallow_any_expr = false

[mypy-awx_plugins.credentials.hashivault]
# crashes with some decorators like `@functools.cache`:
disallow_any_expr = false

[mypy-awx_plugins.credentials.injectors]
# crashes with some decorators like `@functools.cache`:
disallow_any_expr = false

[mypy-awx_plugins.credentials.plugin]
# crashes with some decorators like `@functools.cache`:
disallow_any_expr = false

[mypy-awx_plugins.credentials.tss]
# crashes with some decorators like `@functools.cache`:
disallow_any_expr = false

[mypy-awx_plugins.inventory.plugins]
# crashes with some decorators like `@functools.cache`:
disallow_any_expr = false

[mypy-tests.*]
# crashes with some decorators like `@pytest.mark.parametrize`:
disallow_any_expr = false
# fails on `@hypothesis.given()`:
disallow_any_decorated = false
2 changes: 1 addition & 1 deletion nitpick-style.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ error_summary = true
check_untyped_defs = true

disallow_any_explicit = true
# disallow_any_expr = true # crashes with some decorators like `@functools.cache` and `@pytest.mark.parametrize`
disallow_any_expr = true # crashes with some decorators like `@functools.cache` and `@pytest.mark.parametrize`
disallow_any_decorated = true # fails on `@hypothesis.given()`
disallow_any_generics = true
disallow_any_unimported = true
Expand Down

0 comments on commit 8ea0766

Please sign in to comment.