-
Notifications
You must be signed in to change notification settings - Fork 102
Description
Feature Request
Allow typeCheckingMode to be specified within individual executionEnvironments entries in the configuration file.
Current Behavior
Currently, typeCheckingMode can only be set globally in the configuration. Each execution environment can override individual diagnostic rules, but cannot set a type checking mode directly.
To apply different checking strictness to different folders, users must either:
- Manually specify dozens of individual diagnostic rules per execution environment
- Use the
strictarray (which only supports upgrading to strict mode, not other modes like "recommended")
Desired Behavior
Users should be able to specify typeCheckingMode within execution environments:
{
"typeCheckingMode": "standard",
"executionEnvironments": [
{
"root": "src/legacy",
"typeCheckingMode": "basic"
},
{
"root": "src/new_code",
"typeCheckingMode": "recommended"
}
]
}This would make it much easier to:
- Apply stricter checking to new code while keeping legacy code at a lower level
- Gradually migrate a codebase to stricter checking folder-by-folder
- Use "recommended" mode (basedpyright's default) only in specific parts of a project
Workaround
Currently, the only way to achieve this is to manually copy all diagnostic rules from the desired mode into each execution environment's configuration, which is verbose and error-prone.
Implementation Note
@aviadr1 ([email protected]) is currently working on a PR to implement this feature.
Related
This would be similar to how the strict array works, but more flexible as it would support all type checking modes (off, basic, standard, strict, recommended, all) rather than just strict mode.