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

report an error instead of crashing when attempting to baseline errors from files that are located outside of the project root #982

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

DetachHead
Copy link
Owner

fixes #981

…s from files that are located outside of the project root
@DetachHead DetachHead force-pushed the error-baselining-files-outside-project branch from dc726f8 to 354fbf6 Compare January 6, 2025 10:47
Copy link
Contributor

github-actions bot commented Jan 6, 2025

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/stats/compound_rv.py:116:9 - warning: Return type, "Unknown | Zero | One | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Expr | Any | NaN | Piecewise | Basic | Equality | int | NegativeOne | Integer | Rational | ComplexInfinity | Half | Infinity | NegativeInfinity | Float | Number", is partially unknown (reportUnknownParameterType)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/compound_rv.py:116:9 - warning: Return type, "Unknown | Zero | One | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Expr | Any | NaN | Piecewise | Basic | Equality | int | NegativeOne | Integer | Rational | ComplexInfinity | Half | Infinity | Number | NegativeInfinity", is partially unknown (reportUnknownParameterType)
-     Type of "probability" is "((condition: Unknown, **kwargs: Unknown) -> Unknown) | ((condition: Unknown) -> (Zero | One | Probability | Self@Expr | tuple[Unknown, ...] | Unknown | Sum | Expr | Any | NaN | Piecewise | Basic | Equality | int | NegativeOne | Integer | Rational | ComplexInfinity | Half | Infinity | NegativeInfinity | Float | Number)) | ((condition: Unknown) -> (NaN | Unknown | Piecewise | Integer | Literal[0]))" (reportUnknownMemberType)
+     Type of "probability" is "((condition: Unknown, **kwargs: Unknown) -> Unknown) | ((condition: Unknown) -> (Zero | One | Probability | Self@Expr | tuple[Unknown, ...] | Unknown | Sum | Expr | Any | NaN | Piecewise | Basic | Equality | int | NegativeOne | Integer | Rational | ComplexInfinity | Half | Infinity | Number | NegativeInfinity)) | ((condition: Unknown) -> (NaN | Unknown | Piecewise | Integer | Literal[0]))" (reportUnknownMemberType)
-   /tmp/mypy_primer/projects/sympy/sympy/stats/compound_rv.py:119:16 - warning: Return type, "Unknown | Zero | One | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Expr | Any | NaN | Piecewise | Basic | Equality | int | NegativeOne | Integer | Rational | ComplexInfinity | Half | Infinity | NegativeInfinity | Float | Number", is partially unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/compound_rv.py:119:16 - warning: Return type, "Unknown | Zero | One | Probability | Self@Expr | tuple[Unknown, ...] | Sum | Expr | Any | NaN | Piecewise | Basic | Equality | int | NegativeOne | Integer | Rational | ComplexInfinity | Half | Infinity | Number | NegativeInfinity", is partially unknown (reportUnknownVariableType)
-     Type of "doit" is "((**hints: Unknown) -> Equality) | Unknown | ((**hints: Unknown) -> NaN) | ((**hints: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Expr | Any | Zero | NaN | Piecewise | Basic | None)) | ((**hints: Unknown) -> Unknown)" (reportUnknownMemberType)
+     Type of "doit" is "((**hints: Unknown) -> Equality) | Unknown | ((**hints: Unknown) -> NaN) | ((**hints: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Expr | Any | Zero | NaN | Piecewise | Basic | Equality | None)) | ((**hints: Unknown) -> Unknown)" (reportUnknownMemberType)
-     Type of "summation" is "(f: Unknown, ...) -> (tuple[Unknown, ...] | Unknown | Self@Sum | Self@Expr | Expr | Any | Zero | NaN | Piecewise | Basic | Equality | None)" (reportUnknownVariableType)
+     Type of "summation" is "(f: Unknown, ...) -> (tuple[Unknown, ...] | Unknown | Self@Sum | Self@Expr | Expr | Any | Zero | NaN | Piecewise | Basic | Equality | Sum | None)" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/stats/drv.py:228:9 - warning: Return type, "Zero | One | Probability | Self@Expr | tuple[Unknown, ...] | Unknown | Sum | Expr | Any | NaN | Piecewise | Basic | Equality | int | NegativeOne | Integer | Rational | ComplexInfinity | Half | Infinity | NegativeInfinity | Float | Number", is partially unknown (reportUnknownParameterType)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/drv.py:228:9 - warning: Return type, "Zero | One | Probability | Self@Expr | tuple[Unknown, ...] | Unknown | Sum | Expr | Any | NaN | Piecewise | Basic | Equality | int | NegativeOne | Integer | Rational | ComplexInfinity | Half | Infinity | Number | NegativeInfinity", is partially unknown (reportUnknownParameterType)
-     Type of "density" is "(expr: Unknown, condition: Unknown | None = None, evaluate: bool = True, numsamples: Unknown | None = None, **kwargs: Unknown) -> Unknown" (reportUnknownVariableType)
+     Type of "density" is "(expr: Unknown, condition: Unknown | None = None, evaluate: bool = True, numsamples: Unknown | None = None, **kwargs: Unknown) -> (dict[Unknown, Unknown] | Density | Lambda | Basic | Any | Unknown | FiniteDensity | None)" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/stats/drv.py:242:13 - warning: Type of "dens" is unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/drv.py:242:13 - warning: Type of "dens" is partially unknown
+     Type of "dens" is "dict[Unknown, Unknown] | Density | Lambda | Basic | Any | Unknown | FiniteDensity | None" (reportUnknownVariableType)
-   /tmp/mypy_primer/projects/sympy/sympy/stats/drv.py:245:53 - warning: Argument type is unknown
-     Argument corresponds to parameter "pdf" in function "__new__" (reportUnknownArgumentType)
-   /tmp/mypy_primer/projects/sympy/sympy/stats/drv.py:251:16 - warning: Return type, "Probability | Self@Expr | tuple[Unknown, ...] | Unknown | Sum | Expr | Any | Zero | NaN | Piecewise | Basic | Equality | int | One | NegativeOne | Integer | Rational | ComplexInfinity | Half | Infinity | NegativeInfinity | Float | Number", is partially unknown (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/drv.py:251:16 - warning: Return type, "Probability | Self@Expr | tuple[Unknown, ...] | Unknown | Sum | Expr | Any | Zero | NaN | Piecewise | Basic | Equality | int | One | NegativeOne | Integer | Rational | ComplexInfinity | Half | Infinity | Number | NegativeInfinity", is partially unknown (reportUnknownVariableType)
-     Type of "doit" is "Unknown | ((**hints: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Expr | Any | Zero | NaN | Piecewise | Basic | None)) | ((**hints: Unknown) -> Self@Expr) | ((**hints: Unknown) -> Expr) | Any | ((**hints: Unknown) -> Zero) | ((**hints: Unknown) -> NaN) | ((**hints: Unknown) -> Piecewise) | ((**hints: Unknown) -> Basic) | ((**hints: Unknown) -> Equality)" (reportUnknownMemberType)
+     Type of "doit" is "Unknown | ((**hints: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Expr | Any | Zero | NaN | Piecewise | Basic | Equality | None)) | ((**hints: Unknown) -> Self@Expr) | ((**hints: Unknown) -> Expr) | Any | ((**hints: Unknown) -> Zero) | ((**hints: Unknown) -> NaN) | ((**hints: Unknown) -> Piecewise) | ((**hints: Unknown) -> Basic) | ((**hints: Unknown) -> Equality)" (reportUnknownMemberType)
-     Type of "probability" is "(condition: Unknown) -> (Zero | One | Probability | Self@Expr | tuple[Unknown, ...] | Unknown | Sum | Expr | Any | NaN | Piecewise | Basic | Equality | int | NegativeOne | Integer | Rational | ComplexInfinity | Half | Infinity | NegativeInfinity | Float | Number)" (reportUnknownMemberType)
+     Type of "probability" is "(condition: Unknown) -> Unknown" (reportUnknownMemberType)
-     Type of "doit" is "((**hints: Unknown) -> Equality) | Unknown | ((**hints: Unknown) -> NaN) | ((**hints: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Expr | Any | Zero | NaN | Piecewise | Basic | None))" (reportUnknownMemberType)
+     Type of "doit" is "((**hints: Unknown) -> Equality) | Unknown | ((**hints: Unknown) -> NaN) | ((**hints: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Expr | Any | Zero | NaN | Piecewise | Basic | Equality | None))" (reportUnknownMemberType)
-     Type of "doit" is "((**hints: Unknown) -> Equality) | Unknown | ((**hints: Unknown) -> NaN) | ((**hints: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Expr | Any | Zero | NaN | Piecewise | Basic | None))" (reportUnknownMemberType)
+     Type of "doit" is "((**hints: Unknown) -> Equality) | Unknown | ((**hints: Unknown) -> NaN) | ((**hints: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Expr | Any | Zero | NaN | Piecewise | Basic | Equality | None))" (reportUnknownMemberType)
-     Type of "_test" is "(elem: Unknown) -> (bool | Unknown)" (reportUnknownMemberType)
+     Type of "_test" is "(elem: Unknown) -> Unknown" (reportUnknownMemberType)
-     Type of "doit" is "((**hints: Unknown) -> Equality) | Unknown | ((**hints: Unknown) -> NaN) | ((**hints: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Expr | Any | Zero | NaN | Piecewise | Basic | None))" (reportUnknownMemberType)
+     Type of "doit" is "((**hints: Unknown) -> Equality) | Unknown | ((**hints: Unknown) -> NaN) | ((**hints: Unknown) -> (tuple[Unknown, ...] | Unknown | Sum | Self@Expr | Expr | Any | Zero | NaN | Piecewise | Basic | Equality | None))" (reportUnknownMemberType)
-     Type of "summation" is "(f: Unknown, ...) -> (tuple[Unknown, ...] | Unknown | Self@Sum | Self@Expr | Expr | Any | Zero | NaN | Piecewise | Basic | Equality | None)" (reportUnknownVariableType)
+     Type of "summation" is "(f: Unknown, ...) -> (tuple[Unknown, ...] | Unknown | Self@Sum | Self@Expr | Expr | Any | Zero | NaN | Piecewise | Basic | Equality | Sum | None)" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/joint_rv_types.py:285:9 - warning: Type of "v" is partially unknown
+     Type of "v" is "Expr | Rational | NaN | ComplexInfinity | One | NegativeOne | Zero | Integer | Half | Unknown | NegativeInfinity | Number | Infinity | int" (reportUnknownVariableType)
+   /tmp/mypy_primer/projects/sympy/sympy/stats/joint_rv_types.py:574:29 - warning: Argument type is partially unknown
+     Argument corresponds to parameter "args" in function "__new__"

... (truncated 3823 lines) ...

spack (https://github.com/spack/spack)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/u/package.py:10:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/u/package.py:10:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/u/package.py:12:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/u/package.py:12:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/v/package.py:11:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/v/package.py:11:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/v/package.py:13:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/v/package.py:13:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/w/package.py:13:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/w/package.py:13:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/w/package.py:14:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/w/package.py:14:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/w/package.py:15:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/w/package.py:15:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/w/package.py:17:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/w/package.py:17:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/x/package.py:12:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/x/package.py:12:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/x/package.py:13:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/x/package.py:13:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/x/package.py:15:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/x/package.py:15:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/y/package.py:11:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/flags.test/packages/y/package.py:11:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/requirements.test/packages/t/package.py:11:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/requirements.test/packages/t/package.py:11:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/requirements.test/packages/t/package.py:13:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/requirements.test/packages/t/package.py:13:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/requirements.test/packages/u/package.py:11:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/requirements.test/packages/u/package.py:11:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/requirements.test/packages/v/package.py:11:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/requirements.test/packages/v/package.py:11:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/requirements.test/packages/x/package.py:14:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/requirements.test/packages/x/package.py:14:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/requirements.test/packages/x/package.py:15:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
+   /tmp/mypy_primer/projects/spack/var/spack/repos/requirements.test/packages/x/package.py:15:5 - warning: Result of call expression is of type "(pkg: type[PackageBase]) -> None" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)
-   /tmp/mypy_primer/projects/spack/var/spack/repos/requirements.test/packages/y/package.py:14:5 - warning: Result of call expression is of type "((pkg: type[PackageBase]) -> None)" and is not used; assign to variable "_" if this is intentional (reportUnusedCallResult)

... (truncated 45 lines) ...

@DetachHead DetachHead merged commit 7df6082 into main Jan 6, 2025
20 checks passed
@DetachHead DetachHead deleted the error-baselining-files-outside-project branch January 6, 2025 11:53
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.

crash when attempting to write baseline with files outside of the project root
1 participant