python/basedpyright
Type checks the project. At level all, it also requires annotations.
Part of the python configuration, at the recommended level. It runs at the push stage, once per scope. It runs basedpyright.
Each type error found here becomes a crash that never reaches a user.
What to do
Section titled “What to do”Fix the type, or narrow it where the value arrives. Accept a file that needs another dependency set with gspot ignore python/basedpyright --paths <path> --reason "<why>".
Example
Section titled “Example”count: int = "one" reports an incompatible type. Assign a number, such as count: int = 1, or change the annotation to str.
Turn it off
Section titled “Turn it off”Turn it off for some files, or one of its lint rules, with a reason:
gspot ignore python/basedpyright --paths "<glob>" --reason "<why>"gspot ignore python/basedpyright --rule <rule> --reason "<why>"To silence one place, write a comment such as:
value = payload['key'] # type: ignore[index] # the payload is checked above