Feature
Enhance mypy's mypy.ini discovery rules to look in ancestor directories, in the same way that ruff looks for its ruff.toml file.
Pitch
Let's say I'm working in a monorepo, where subpackages live next to each other in a file system layout similar to this:
README.md
# other monorepo top level files
ruff.toml
libs/
subpackageA/
pyproject.toml
mypy.ini
src/
tests/
docs/
subpackageB/
pyproject.toml
mypy.ini
src/
tests/
docs/
...
When I cd libs/subpackageA to do development work in just subpackageA, I would like for my type checking to be driven by a common mypy.ini file, at the top level of my repo. However, mypy won't walk up the filesystem to discover the mypy.ini file at the top-level. Contrast that with ruff's discovery rules which do walk up the filesystem until it finds a ruff.toml file.
There are workarounds: 1) symlink the subprojects's mypy.ini to the root level mypy.ini; 2) copy the same mypy.ini file into each subpackage directory. Neither option is all that great. A rule similar to ruff's would let me eliminate the symlinks and move the mypy.ini file to the root of my repo, so that its settings can be easily shared across all subpackages in my monorepo.
Feature
Enhance mypy's
mypy.inidiscovery rules to look in ancestor directories, in the same way thatrufflooks for itsruff.tomlfile.Pitch
Let's say I'm working in a monorepo, where subpackages live next to each other in a file system layout similar to this:
When I
cd libs/subpackageAto do development work in justsubpackageA, I would like for my type checking to be driven by a commonmypy.inifile, at the top level of my repo. However, mypy won't walk up the filesystem to discover themypy.inifile at the top-level. Contrast that with ruff's discovery rules which do walk up the filesystem until it finds aruff.tomlfile.There are workarounds: 1) symlink the subprojects's
mypy.inito the root levelmypy.ini; 2) copy the samemypy.inifile into each subpackage directory. Neither option is all that great. A rule similar to ruff's would let me eliminate the symlinks and move themypy.inifile to the root of my repo, so that its settings can be easily shared across all subpackages in my monorepo.