Skip to content

Commit

Permalink
🧪 Disallow untyped decorators in MyPy
Browse files Browse the repository at this point in the history
With the exception of the tests due to
HypothesisWorks/hypothesis#4123.
  • Loading branch information
webknjaz committed Oct 4, 2024
1 parent 5d87e60 commit 9c964aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ 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_decorated = true # fails on `@hypothesis.example()` and `@hypothesis.given()`
disallow_any_decorated = true
disallow_any_generics = true
disallow_any_unimported = true
disallow_incomplete_defs = true
Expand Down Expand Up @@ -56,3 +56,7 @@ warn_redundant_casts = true
warn_return_any = true
warn_unused_configs = true
warn_unused_ignores = true

[mypy-tests.*]
# 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 @@ 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_decorated = true # fails on `@hypothesis.example()` and `@hypothesis.given()`
disallow_any_decorated = true # fails on `@hypothesis.given()`
disallow_any_generics = true
disallow_any_unimported = true
disallow_incomplete_defs = true
Expand Down

0 comments on commit 9c964aa

Please sign in to comment.