DetachHead / basedpyright

pyright fork with various type checking improvements, improved vscode support and pylance features built into the language server
https://docs.basedpyright.com
Other
1.02k stars 19 forks source link

switch from webpack to rspack #736

Open DetachHead opened 22 hours ago

DetachHead commented 22 hours ago

fixes #723

github-actions[bot] commented 21 hours ago

Diff from mypy_primer, showing the effect of this PR on open source code:

sympy (https://github.com/sympy/sympy)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/ode/ode.py:2281:46 - error: Type of "i" is unknown (reportUnknownVariableType)
-     Type of "sqrtdenest" is "(expr: Unknown, max_iter: int = 3) -> Unknown" (reportUnknownVariableType)
+     Type of "sqrtdenest" is "(expr: Unknown, max_iter: int = 3) -> (Unknown | Mul | Pow | Order | Expr | Add | None)" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/ode/subscheck.py:385:22 - error: Type of "simplify" is partially unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/ode/subscheck.py:385:22 - error: Type of "simplify" is unknown (reportUnknownMemberType)
-     Type of "simplify" is "Unknown | ((**kwargs: Unknown) -> Unknown)" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/ode/subscheck.py:385:37 - error: "simplify" is not a known attribute of "None" (reportOptionalMemberAccess)
-     Type of "_" is "Unknown | Any | Literal[False]" (reportUnknownVariableType)
+     Type of "_" is "Unknown | Literal[False]" (reportUnknownVariableType)
-     Type of "_" is "Unknown | Any | Literal[False]" (reportUnknownVariableType)
+     Type of "_" is "Unknown | Literal[False]" (reportUnknownVariableType)
-     Type of "_" is "Unknown | Any | Literal[False]" (reportUnknownVariableType)
+     Type of "_" is "Unknown | Literal[False]" (reportUnknownVariableType)
-     Type of "_" is "Unknown | Any | Literal[False]" (reportUnknownVariableType)
+     Type of "_" is "Unknown | Literal[False]" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:501:5 - error: Type of "eqs" is partially unknown
+     Type of "eqs" is "list[Unknown]" (reportUnknownVariableType)
-     Argument type is "Unknown | Any | _NotImplementedType" (reportUnknownArgumentType)
+     Argument type is "Unknown | _NotImplementedType" (reportUnknownArgumentType)
-     Type of "eqs" is "list[Unknown | Any]" (reportUnknownVariableType)
+     Type of "eqs" is "list[Unknown]" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:505:16 - error: Argument type is partially unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:505:16 - error: Argument type is unknown
-     Argument corresponds to parameter "iterable" in function "__init__"
+     Argument corresponds to parameter "iterable" in function "__init__" (reportUnknownArgumentType)
-     Argument type is "Unknown | Any" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:717:18 - error: Argument type is unknown
+     Argument corresponds to parameter "f" in function "solve" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:1768:5 - error: Type of "eqs" is partially unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:1768:5 - error: Type of "eqs" is unknown (reportUnknownVariableType)
-     Type of "eqs" is "Unknown | Any" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:1769:18 - error: Argument type is unknown
+     Argument corresponds to parameter "f" in function "solve" (reportUnknownArgumentType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:1770:18 - error: Argument type is unknown
+     Argument corresponds to parameter "f" in function "solve" (reportUnknownArgumentType)
-     Type of "eq" is "_NotImplementedType | Unknown" (reportUnknownVariableType)
+     Type of "eq" is "_NotImplementedType | GreaterThan | Unknown | Equality | Relational | Unequality" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/frv_types.py:236:16 - error: Operator "&" not supported for types "_NotImplementedType | GreaterThan | Unknown | Equality | Relational | Unequality" and "_NotImplementedType | LessThan | Unknown | Equality | Relational | Unequality"
+     Operator "&" not supported for types "GreaterThan" and "LessThan"
+     Operator "&" not supported for types "GreaterThan" and "Equality"
+     Operator "&" not supported for types "GreaterThan" and "Relational"
+     Operator "&" not supported for types "GreaterThan" and "Unequality"
+     Operator "&" not supported for types "Equality" and "LessThan"
+     Operator "&" not supported for types "Equality" and "Equality"
+     Operator "&" not supported for types "Equality" and "Relational"
+     Operator "&" not supported for types "Equality" and "Unequality"
+     ... (reportOperatorIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/frv_types.py:425:16 - error: Operator "&" not supported for types "_NotImplementedType | GreaterThan | Unknown | Equality | Relational | Unequality" and "_NotImplementedType | LessThan | Unknown | Equality | Relational | Unequality"
+     Operator "&" not supported for types "GreaterThan" and "LessThan"
+     Operator "&" not supported for types "GreaterThan" and "Equality"
+     Operator "&" not supported for types "GreaterThan" and "Relational"
+     Operator "&" not supported for types "GreaterThan" and "Unequality"
+     Operator "&" not supported for types "Equality" and "LessThan"
+     Operator "&" not supported for types "Equality" and "Equality"
+     Operator "&" not supported for types "Equality" and "Relational"
+     Operator "&" not supported for types "Equality" and "Unequality"
+     ... (reportOperatorIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/frv_types.py:713:17 - error: Operator "&" not supported for types "_NotImplementedType | GreaterThan | Unknown | Equality | Relational | Unequality" and "_NotImplementedType | LessThan | Unknown | Equality | Relational | Unequality"
+     Operator "&" not supported for types "GreaterThan" and "LessThan"
+     Operator "&" not supported for types "GreaterThan" and "Equality"
+     Operator "&" not supported for types "GreaterThan" and "Relational"
+     Operator "&" not supported for types "GreaterThan" and "Unequality"
+     Operator "&" not supported for types "Equality" and "LessThan"
+     Operator "&" not supported for types "Equality" and "Equality"
+     Operator "&" not supported for types "Equality" and "Relational"
+     Operator "&" not supported for types "Equality" and "Unequality"
+     ... (reportOperatorIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/frv_types.py:771:22 - error: Invalid conditional operand of type "_NotImplementedType | StrictGreaterThan | Unknown | Equality | Relational | Unequality"
+     Method __bool__ for type "StrictGreaterThan" returns type "NoReturn" rather than "bool"
+     Method __bool__ for type "Equality" returns type "NoReturn" rather than "bool"
+     Method __bool__ for type "Relational" returns type "NoReturn" rather than "bool"
+     Method __bool__ for type "Unequality" returns type "NoReturn" rather than "bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/frv_types.py:771:39 - error: Invalid conditional operand of type "_NotImplementedType | LessThan | Unknown | Equality | Relational | Unequality"
+     Method __bool__ for type "LessThan" returns type "NoReturn" rather than "bool"
+     Method __bool__ for type "Equality" returns type "NoReturn" rather than "bool"
+     Method __bool__ for type "Relational" returns type "NoReturn" rather than "bool"
+     Method __bool__ for type "Unequality" returns type "NoReturn" rather than "bool" (reportGeneralTypeIssues)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/frv_types.py:811:17 - error: Operator "&" not supported for types "_NotImplementedType | GreaterThan | Unknown | Equality | Relational | Unequality" and "_NotImplementedType | LessThan | Unknown | Equality | Relational | Unequality"
+     Operator "&" not supported for types "GreaterThan" and "LessThan"
+     Operator "&" not supported for types "GreaterThan" and "Equality"
+     Operator "&" not supported for types "GreaterThan" and "Relational"
+     Operator "&" not supported for types "GreaterThan" and "Unequality"
+     Operator "&" not supported for types "Equality" and "LessThan"
+     Operator "&" not supported for types "Equality" and "Equality"
+     Operator "&" not supported for types "Equality" and "Relational"
+     Operator "&" not supported for types "Equality" and "Unequality"
+     ... (reportOperatorIssue)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/frv_types.py:814:17 - error: Operator "&" not supported for types "_NotImplementedType | GreaterThan | Unknown | Equality | Relational | Unequality" and "_NotImplementedType | LessThan | Unknown | Equality | Relational | Unequality"
+     Operator "&" not supported for types "GreaterThan" and "LessThan"
+     Operator "&" not supported for types "GreaterThan" and "Equality"
+     Operator "&" not supported for types "GreaterThan" and "Relational"
+     Operator "&" not supported for types "GreaterThan" and "Unequality"
+     Operator "&" not supported for types "Equality" and "LessThan"
+     Operator "&" not supported for types "Equality" and "Equality"
+     Operator "&" not supported for types "Equality" and "Relational"
+     Operator "&" not supported for types "Equality" and "Unequality"
+     ... (reportOperatorIssue)
-     Type of "condition" is "_NotImplementedType | Unknown" (reportUnknownVariableType)
+     Type of "condition" is "_NotImplementedType | StrictLessThan | Unknown | Equality | Relational | Unequality" (reportUnknownVariableType)
-     Type of "condition" is "_NotImplementedType | Unknown" (reportUnknownVariableType)
+     Type of "condition" is "_NotImplementedType | StrictGreaterThan | Unknown | Equality | Relational | Unequality" (reportUnknownVariableType)
-     Type of "condition" is "_NotImplementedType | Unknown" (reportUnknownVariableType)
+     Type of "condition" is "_NotImplementedType | LessThan | Unknown | Equality | Relational | Unequality" (reportUnknownVariableType)

... (truncated 68 lines) ...

spack (https://github.com/spack/spack)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/talloc/package.py:24:5 - error: Result of call expression is of type "((pkg: PackageBase) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/talloc/package.py:24:5 - error: Result of call expression is of type "(pkg: PackageBase) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/talloc/package.py:27:5 - error: Result of call expression is of type "((pkg: PackageBase) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/talloc/package.py:27:5 - error: Result of call expression is of type "(pkg: PackageBase) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:31:5 - error: Result of call expression is of type "((pkg: PackageBase) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:31:5 - error: Result of call expression is of type "(pkg: PackageBase) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:43:5 - error: Result of call expression is of type "((pkg: PackageBase) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:43:5 - error: Result of call expression is of type "(pkg: PackageBase) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:44:5 - error: Result of call expression is of type "((pkg: PackageBase) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:44:5 - error: Result of call expression is of type "(pkg: PackageBase) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:46:5 - error: Result of call expression is of type "((pkg: PackageBase) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:46:5 - error: Result of call expression is of type "(pkg: PackageBase) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:47:5 - error: Result of call expression is of type "((pkg: PackageBase) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:47:5 - error: Result of call expression is of type "(pkg: PackageBase) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:48:5 - error: Result of call expression is of type "((pkg: PackageBase) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:48:5 - error: Result of call expression is of type "(pkg: PackageBase) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:61:9 - error: Result of call expression is of type "((pkg: PackageBase) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:61:9 - error: Result of call expression is of type "(pkg: PackageBase) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:62:9 - error: Result of call expression is of type "((pkg: PackageBase) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:62:9 - error: Result of call expression is of type "(pkg: PackageBase) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:63:9 - error: Result of call expression is of type "((pkg: PackageBase) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:63:9 - error: Result of call expression is of type "(pkg: PackageBase) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:64:9 - error: Result of call expression is of type "((pkg: PackageBase) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:64:9 - error: Result of call expression is of type "(pkg: PackageBase) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:65:9 - error: Result of call expression is of type "((pkg: PackageBase) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:65:9 - error: Result of call expression is of type "(pkg: PackageBase) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:66:9 - error: Result of call expression is of type "((pkg: PackageBase) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:66:9 - error: Result of call expression is of type "(pkg: PackageBase) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:68:5 - error: Result of call expression is of type "((pkg: PackageBase) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tamaas/package.py:68:5 - error: Result of call expression is of type "(pkg: PackageBase) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tandem/package.py:29:5 - error: Result of call expression is of type "((pkg: PackageBase) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tandem/package.py:30:5 - error: Result of call expression is of type "((pkg: PackageBase) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tandem/package.py:29:5 - error: Result of call expression is of type "(pkg: PackageBase) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tandem/package.py:30:5 - error: Result of call expression is of type "(pkg: PackageBase) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tandem/package.py:50:5 - error: Result of call expression is of type "((pkg: PackageBase) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tandem/package.py:53:9 - error: Result of call expression is of type "((pkg: PackageBase) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tandem/package.py:56:9 - error: Result of call expression is of type "((pkg: PackageBase) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/tandem/package.py:58:5 - error: Result of call expression is of type "((pkg: PackageBase) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)

... (truncated 6236 lines) ...