microsoft / microsoft/vscode-mypy
Support reportingScope "project"
- Dominant language
- Python
- Stars
- 150
- Forks
- 39
- Avg merge
- 21h 45m
- Merged PRs (30d)
- 8
Description
It would be great if this plugin could support a reporting scope of `project`, which typechecks all files in the current project (defined as the first directory in the tree with a `pyproject.toml` file).
We have a large monorepo where:
- `file` scope is not useful as we need cross-file type checking
- `workspace` scope is too broad, making type checking slow, and requiring the entire repo to be type-checkable (sometimes we files that will cause mypy to throw, such as a missing `__init__.py` file)
I'm not sure if mypy itself supports this kind of scoping, but if not, perhaps this plugin could detect the current project and pass that in as the directory to the mypy command i.e. `python -m mypy /path/to/project`.
At the same time, it is important that mypy config is respected from the root of the workspace. In monorepos, we tend to have a root `pyproject.toml` that defines mypy config, and it would be great to respect that.
Contributor guide
Research direction
Start by locating the plugin's scope handling and the entry point that invokes mypy. Use the issue's project definition: the first directory in the tree containing pyproject.toml; done means project scope type-checks that directory while still respecting mypy configuration from the workspace root.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, vscode
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100