Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typeCheckingMode still defaulting to "all" in the language server when there's no config file #791

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

DetachHead
Copy link
Owner

fixes #785

really should start looking into #64, cuz this is so messy and error prone

Copy link
Contributor

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

sympy (https://github.com/sympy/sympy)
-     Type of "sqrtdenest" is "(expr: Unknown, max_iter: int = 3) -> (Unknown | Mul | Pow | Order | Expr | Add | None)" (reportUnknownVariableType)
+     Type of "sqrtdenest" is "(expr: Unknown, max_iter: int = 3) -> Unknown" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/ode/subscheck.py:385:22 - warning: Type of "simplify" is unknown (reportUnknownMemberType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/ode/subscheck.py:385:22 - warning: Type of "simplify" is partially unknown
+     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 | 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)
+     Type of "_" is "Unknown | Any | Literal[False]" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:501:5 - warning: Type of "eqs" is partially unknown
-     Type of "eqs" is "list[Unknown]" (reportUnknownVariableType)
-     Argument type is "Unknown | _NotImplementedType" (reportUnknownArgumentType)
+     Argument type is "Unknown | Any | _NotImplementedType" (reportUnknownArgumentType)
-     Type of "eqs" is "list[Unknown]" (reportUnknownVariableType)
+     Type of "eqs" is "list[Unknown | Any]" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:505:16 - warning: Argument type is unknown
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:505:16 - warning: Argument type is partially unknown
-     Argument corresponds to parameter "iterable" in function "__init__" (reportUnknownArgumentType)
+     Argument corresponds to parameter "iterable" in function "__init__"
+     Argument type is "Unknown | Any" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:717:18 - warning: 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 - warning: Type of "eqs" is unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:1768:5 - warning: Type of "eqs" is partially unknown
+     Type of "eqs" is "Unknown | Any" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/solvers/tests/test_solvers.py:1769:18 - warning: 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 - warning: Argument type is unknown
-     Argument corresponds to parameter "f" in function "solve" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/stats/tests/test_symbolic_multivariate.py:64:50 - warning: Argument type is unknown
-     Argument corresponds to parameter "expr" in function "__new__" (reportUnknownArgumentType)
-     Type of "c" is "Unknown | _NotImplementedType" (reportUnknownVariableType)
+     Type of "c" is "Unknown | Any | _NotImplementedType" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_lambdify.py:634:29 - warning: Argument type is unknown
-     Argument corresponds to parameter "expr" in function "lambdify" (reportUnknownArgumentType)
-     Type of "dot" is "(b: Unknown, hermitian: Unknown | None = None, conjugate_convention: Unknown | None = None) -> Unknown" (reportUnknownMemberType)
+     Type of "dot" is "(b: Unknown, hermitian: Unknown | None = None, conjugate_convention: Unknown | None = None) -> (Unknown | Any)" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/utilities/tests/test_wester.py:1313:24 - warning: Argument type is unknown
-     Argument corresponds to parameter "e" in function "expand" (reportUnknownArgumentType)
-     Type of "dot" is "(b: Unknown, hermitian: Unknown | None = None, conjugate_convention: Unknown | None = None) -> Unknown" (reportUnknownMemberType)
+     Type of "dot" is "(b: Unknown, hermitian: Unknown | None = None, conjugate_convention: Unknown | None = None) -> (Unknown | Any)" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/vector/coordsysrect.py:289:25 - warning: Argument type is unknown
-     Argument corresponds to parameter "expr" in function "simplify" (reportUnknownArgumentType)
-     Type of "dot" is "(b: Unknown, hermitian: Unknown | None = None, conjugate_convention: Unknown | None = None) -> Unknown" (reportUnknownMemberType)
+     Type of "dot" is "(b: Unknown, hermitian: Unknown | None = None, conjugate_convention: Unknown | None = None) -> (Unknown | Any)" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/vector/coordsysrect.py:289:55 - warning: Argument type is unknown
-     Argument corresponds to parameter "expr" in function "simplify" (reportUnknownArgumentType)
-     Type of "dot" is "(b: Unknown, hermitian: Unknown | None = None, conjugate_convention: Unknown | None = None) -> Unknown" (reportUnknownMemberType)
+     Type of "dot" is "(b: Unknown, hermitian: Unknown | None = None, conjugate_convention: Unknown | None = None) -> (Unknown | Any)" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/vector/coordsysrect.py:290:30 - warning: Argument type is unknown
-     Argument corresponds to parameter "expr" in function "simplify" (reportUnknownArgumentType)
- 87978 errors, 509294 warnings, 0 notes
+ 87979 errors, 509284 warnings, 0 notes

spack (https://github.com/spack/spack)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/builtin/packages/wxpropgrid/package.py:20:5 - warning: 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/wxpropgrid/package.py:20:5 - warning: 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/wxpropgrid/package.py:22:5 - warning: 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/wxpropgrid/package.py:22:5 - warning: 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/wxwidgets/package.py:34:5 - warning: 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/wxwidgets/package.py:34:5 - warning: 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/wxwidgets/package.py:35:5 - warning: 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/wxwidgets/package.py:35:5 - warning: 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/wxwidgets/package.py:41:5 - warning: 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/wxwidgets/package.py:41:5 - warning: 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/wxwidgets/package.py:42:5 - warning: 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/wxwidgets/package.py:42:5 - warning: 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/wxwidgets/package.py:43:5 - warning: 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/wxwidgets/package.py:43:5 - warning: 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/x11perf/package.py:18:5 - warning: 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/x11perf/package.py:18:5 - warning: 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/x11perf/package.py:20:5 - warning: 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/x11perf/package.py:20:5 - warning: 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/x11perf/package.py:21:5 - warning: 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/x11perf/package.py:21:5 - warning: 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/x11perf/package.py:22:5 - warning: 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/x11perf/package.py:22:5 - warning: 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/x11perf/package.py:23:5 - warning: 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/x11perf/package.py:23:5 - warning: 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/x11perf/package.py:25:5 - warning: 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/x11perf/package.py:25:5 - warning: 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/x11perf/package.py:26:5 - warning: 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/x11perf/package.py:26:5 - warning: 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/x11perf/package.py:27:5 - warning: 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/x11perf/package.py:27:5 - warning: 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/x264/package.py:19:5 - warning: 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/x264/package.py:19:5 - warning: 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/x264/package.py:21:5 - warning: 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/x264/package.py:21:5 - warning: 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/xalan-c/package.py:25:5 - warning: 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/xalan-c/package.py:25:5 - warning: 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/xalan-c/package.py:26:5 - warning: 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/xalan-c/package.py:26:5 - warning: Result of call expression is of type "((pkg: PackageBase) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)

... (truncated 394 lines) ...

@DetachHead DetachHead merged commit e2f87b0 into main Oct 18, 2024
20 checks passed
@DetachHead DetachHead deleted the fix-default-typecheckingmode branch October 18, 2024 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

basedpyright.analysis.typeCheckingMode appears to still default to "all" in v1.19.0
1 participant