Skip to content
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
Prev Previous commit
Add --strict-concatenate
  • Loading branch information
AlexWaygood authored May 5, 2023
commit 7d9b5f7bbc8257408be77fec63c86597810307af
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ python_version = "3.7"
pretty = true
enable_error_code = "ignore-without-code"
Copy link
Copy Markdown
Member Author

@AlexWaygood AlexWaygood May 2, 2023

Choose a reason for hiding this comment

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

This means that mypy will emit an error if you do a bare # type: ignore without a specific error code (e.g. you should use # type: ignore[import] to suppress mypy's import-related errors)

disallow_any_generics = true
Copy link
Copy Markdown
Member Author

@AlexWaygood AlexWaygood May 2, 2023

Choose a reason for hiding this comment

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

This means that mypy will forbid using, for example, list or typing.List as an annotation. You should use list[int] or typing.List[int] instead, which gives the type checker much more information to work with.

strict_concatenate = true
Copy link
Copy Markdown
Member Author

@AlexWaygood AlexWaygood May 5, 2023

Choose a reason for hiding this comment

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

I doubt we'll be making much use of typing.Concatenate in pyperformance, but this is one of the stricter settings that mypy offers which can be easily enabled from the get-go, so we may as well enable it now

warn_redundant_casts = true
warn_unused_ignores = true
warn_unused_configs = true
Expand Down