refactor(views): reuse invalid-view results and row selectors (#14314)

This commit is contained in:
Vincent Koc authored and GitHub committed 2026-11-24 16:43:15 +08:00
1 parent f9518dea59
commit 5dafc31d23
53 files changed
+333 -708

No files matched your search

+4 -10
View File
@@ -3,14 +3,14 @@ import {
pythonPycSchema,
type PythonPycCodeObject,
} from "../python/pythonPyc.js";
import { err, ok } from "../result.js";
import { ok } from "../result.js";
import type { AnalysisViewParent } from "./analysisViewParent.js";
import {
ownedView,
type AdmittedView,
type SummaryAnalysisView,
} from "./analysisViewShape.js";
import { analysisViewInputError } from "./analysisViewErrors.js";
import { invalidAnalysisView } from "./analysisViewErrors.js";
import { createAnalysisViewResultReader } from "./analysisViewParent.js";
import {
boundedViewMessages,
@@ -64,14 +64,8 @@ export const projectPythonPycView = (
SummaryAnalysisView | z.output<typeof pythonPycViewRequestSchema>
>(admitted, "summary", "python-pyc");
if (view === undefined)
return err(
analysisViewInputError([
{
path: ["view"],
reason: "invalid_value",
message: "Python pyc Evidence supports summary and python-pyc views.",
},
]),
return invalidAnalysisView(
"Python pyc Evidence supports summary and python-pyc views.",
);
const parsed = readReport(parent);
if (!parsed.ok) return parsed;