microsoft / pyright

Static Type Checker for Python
Other
12.7k stars 1.35k forks source link

Fix severity overrides being skipped when there's a pyrightconfig.json #8295

Closed rchiodo closed 2 weeks ago

rchiodo commented 2 weeks ago

In these two issues, the severity override being set in the user's settings.json is not being applied:

https://github.com/microsoft/pylance-release/issues/6087 https://github.com/microsoft/pylance-release/issues/6085

The reason for this was the commandline settings were never being applied when there's a pyrightconfig.json. I modified the logic to apply the command line options first and then let the pyrightconfig.json files to override those values.

I also found an issue in the test code that prevented the LSP tests from cleaning up server instances.

github-actions[bot] commented 2 weeks ago

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

rchiodo commented 2 weeks ago

After some discussion we decided to:

We're going to try this out and see how many people actually have this situation - where they're setting these values and they also have a pyrightconfig.json