basedmypy icon indicating copy to clipboard operation
basedmypy copied to clipboard

Specify configuration override using path instead of module name

Open Zeckie opened this issue 3 years ago • 2 comments

Currently, [[tool.mypy.overrides]] in pyproject.toml needs to specify what the overrides apply to using module. Would be useful to be able to specify path instead (eg. to apply a different configuration to everything in stubs folder).

eg.

[[tool.mypy.overrides]]
path = "stubs"
allow_untyped_defs = true

Edit Another usecase is type checking misc scripts that aren't in a package.

Zeckie avatar Apr 22 '22 07:04 Zeckie

Potentially also paths like this, to only match pyi files within the stubs folder (or any subfolders)

[[tool.mypy.overrides]]
path = "stubs/**/*.pyi"
allow_untyped_defs = true

Zeckie avatar Apr 22 '22 07:04 Zeckie

I definitely agree, this is a much needed feature. Another usecase is type checking misc scripts that aren't in a package.

KotlinIsland avatar Apr 22 '22 08:04 KotlinIsland