Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Add stricter mypy options #15694

Merged
merged 8 commits into from
May 31, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,17 @@ no_implicit_optional = True

# Strict checks, see mypy --help
warn_unused_configs = True
# disallow_any_generics = True
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it useful to list the disabled ones? I think so, but curious of what others think.

disallow_subclassing_any = True
# disallow_untyped_calls = True
disallow_untyped_defs = True
disallow_incomplete_defs = True
# check_untyped_defs = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised---I thought we had this option enabled!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This keeps confusing me, but check_untyped_defs is when mypy attempts to check the internals of functions that are not fully typed. Since we use disallow_untyped_defs this mostly doesn't apply to us, except for the treecache stuff which I've failed several times at typing now.

# disallow_untyped_decorators = True
warn_redundant_casts = True
warn_unused_ignores = True
# warn_return_any = True
# no_implicit_reexport = True
strict_equality = True
strict_concatenate = True

Expand Down