Is your feature request related to a problem? Please describe.
thanks for adding the extends option! however for my use case i would like to be able to run pyright once in the root of my project and have it automatically type check each file with their correct pyrightconfig.json file.
for example, if i have the following project structure:
.
└── project/
├── foo/
│ └── pyrightconfig.json (extends the top level pyrightconfig.json)
├── bar/
│ └── pyrightconfig.json (extends the top level pyrightconfig.json)
└── pyrightconfig.json
and i run pyright in the project root, it seems to typecheck every file with the top-level pyrightconfig.json file. so instead, i have to run it several times for each config file:
this isn't a big deal. typescript behaves the same way, and i can set up the CI to run both commands. however unlike typescript, this feature doesn't seem to work well with vscode, because the pyright/pylance extensions only look at one config file for the whole project, meaning it shows incorrect errors on the files in the foo and bar folders because vscode is type checking them with the wrong config file.
Describe the solution you’d like
when not specifying a config file explicitly with --project argument, the language server should look for the closest pyrightconfig.json file (or pyproject.toml) relative to each file it checks, rather than using the same top-level config file for each one.
original issue: https://github.com/microsoft/pyright/issues/8019
Is your feature request related to a problem? Please describe. thanks for adding the
extends
option! however for my use case i would like to be able to runpyright
once in the root of my project and have it automatically type check each file with their correctpyrightconfig.json
file.for example, if i have the following project structure:
and i run
pyright
in the project root, it seems to typecheck every file with the top-levelpyrightconfig.json
file. so instead, i have to run it several times for each config file:this isn't a big deal. typescript behaves the same way, and i can set up the CI to run both commands. however unlike typescript, this feature doesn't seem to work well with vscode, because the pyright/pylance extensions only look at one config file for the whole project, meaning it shows incorrect errors on the files in the
foo
andbar
folders because vscode is type checking them with the wrong config file.Describe the solution you’d like when not specifying a config file explicitly with
--project
argument, the language server should look for the closestpyrightconfig.json
file (orpyproject.toml
) relative to each file it checks, rather than using the same top-level config file for each one.