Skip to content

Permit configuration via a stand-alone TOML file (mypy.toml) #18617

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
AA-Turner opened this issue Feb 6, 2025 · 1 comment
Open

Permit configuration via a stand-alone TOML file (mypy.toml) #18617

AA-Turner opened this issue Feb 6, 2025 · 1 comment
Labels
feature topic-configuration Configuration files and flags

Comments

@AA-Turner
Copy link
Member

Feature

In #5205, MyPy gained support for declaring configuration in the TOML format, but only in pyproject.toml. I propose supporting configuration via a stand-alone TOML document, such as mypy.toml or .mypy.toml.

Pitch

This parallels, and perhaps would eventually replace, configuration via mypy.ini. This is most useful when checking non-project code, such as in Python (python/cpython#129708), where we have several distinct mypy.ini files to support type-checking different directories of a larger project. It may be useful for mono-repo layouts, where again the use of pyproject.toml is undesirable. Finally, this would be useful to keep tool configuration to independent files — in the Sphinx project, there are several hundred lines of mypy configuration in pyproject.toml, dominating the content of the file.

A

@sobolevn sobolevn added the topic-configuration Configuration files and flags label Feb 6, 2025
@Avasam
Copy link
Contributor

Avasam commented Feb 19, 2025

The .ini format also has its limitations. Like not supporting comments at the end of a line and a weird exclude.

Additional benefits includes: a single toml formatter (rather than needing an ini formatter just for this config). And IntelliSense could be provided through a schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature topic-configuration Configuration files and flags
Projects
None yet
Development

No branches or pull requests

3 participants