fix: address Codex PR review findings
This commit is contained in:
1 parent
0f164b6de5
commit
a7974abb08
44 files changed
+3317
-667
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import type { WorkflowTask } from "../../types.js";
|
||||
import type { ScriptIssue } from "./types.js";
|
||||
import { hasMvelFinalExpression } from "./mvel-subset.js";
|
||||
|
||||
/** Mask literals/comments without moving offsets used by diagnostics. */
|
||||
function scanMvelCode(code: string, issues: ScriptIssue[]): string {
|
||||
@@ -84,10 +85,10 @@ export function lintMvelCode(
|
||||
|
||||
const executableCode = scanMvelCode(code, issues);
|
||||
const hasRet = /\breturn\b/.test(executableCode);
|
||||
if (!hasRet) {
|
||||
if (!hasRet && !hasMvelFinalExpression(code)) {
|
||||
issues.push({
|
||||
level: "warning",
|
||||
message: "MVEL 代码中未发现 return 语句,合思代码节点通常需要 return 包装后的 Map 或结果对象",
|
||||
message: "MVEL 代码中未发现显式 return 或可确定的末尾结果表达式;请确认所需结果位于脚本末尾",
|
||||
rule: "missing-return",
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user