This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Disallow untyped defs by default#11302
Closed
callahad wants to merge 3 commits intomatrix-org:developfrom
Closed
Conversation
This is mainly to take advantage of the significantly more convenient
syntax for module overrides. For example, instead of:
[mypy-synapse.api.*]
disallow_untyped_defs = True
[mypy-synapse.app.*]
disallow_untyped_defs = True
[mypy-synapse.crypto.*]
disallow_untyped_defs = True
The pyproject.toml file allows:
[[tool.mypy.overrides]]
module = [
"synapse.api.*",
"synapse.app.*",
"synapse.crypto.*",
]
disallow_untyped_defs = true
Not a huge difference with two or three modules, but we list many more.
- For disallow_untyped_defs, this uses 47 lines instead of 129.
- For ignore_missing_imports, this uses 34 lines instead of 90.
This is especially important as I'm about to set disallow_untyped_defs
at the global level and provide module-level opt-outs so that we require
typed definitions in all newly added code.
Signed-off-by: Dan Callahan <danc@element.io>
Signed-off-by: Dan Callahan <danc@element.io>
Signed-off-by: Dan Callahan <danc@element.io>
Member
|
I find it very confusing when there's major refactorings done at the same time as changes. Can we split this into two PRs so we can discuss the changes separately:
|
4 tasks
This was referenced Apr 1, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Not the prettiest mypy configuration, but it's something.
The first commit message in this PR may be of interest.
Pull Request Checklist
EventStoretoEventWorkerStore.".code blocks.(run the linters)