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

Commit d435e9c

Browse files
committed
Move mypy configuration into pyproject.toml
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. 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. Switching to this format will save several hundred lines of repetitive boilerplate and clarify the intent of each stanza. It's also easier to keep things ordered, since it works to just pipe a region to `sort`, while mypy.ini requires handling a 3-line structure. Ordering helps keep these settings synced up with the files on disk. Signed-off-by: Dan Callahan <[email protected]>
1 parent c99da2d commit d435e9c

File tree

3 files changed

+251
-384
lines changed

3 files changed

+251
-384
lines changed

changelog.d/11315.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Port mypy.ini into pyproject.toml.

mypy.ini

Lines changed: 0 additions & 384 deletions
This file was deleted.

0 commit comments

Comments
 (0)