Release v0.10.4: Built-in rule linter, dynamic TS plugin loader with fault-tolerant fallback, and default-disabled global config
This commit is contained in:
1 parent
cdab1e2009
commit
1cf35dfd78
23 files changed
+914
-77
No files matched your search
@@ -45,6 +45,7 @@ export function handleConfigCommand(action: string | undefined, maybeName: strin
|
||||
: previousConfig.defaultCorpId
|
||||
: undefined;
|
||||
const config = saveGlobalConfig({
|
||||
...previousConfig,
|
||||
stateful,
|
||||
...(defaultCorpId ? { defaultCorpId } : {})
|
||||
});
|
||||
@@ -52,5 +53,42 @@ export function handleConfigCommand(action: string | undefined, maybeName: strin
|
||||
return;
|
||||
}
|
||||
|
||||
throw new Error(`Unknown config command: ${action ?? ""}. Run 'seal-use help' for available commands.`);
|
||||
if (action === "lint") {
|
||||
const subAction = maybeName ?? stringOption(args.options.state) ?? stringOption(args.options.enable);
|
||||
const previousConfig = loadGlobalConfig();
|
||||
const currentLint = previousConfig.lint ?? { enabled: false, activeLinter: "builtin", minScore: 0 };
|
||||
|
||||
if (!subAction || subAction === "status" || subAction === "get") {
|
||||
printJson({ lint: currentLint, configFile: resolveGlobalConfigFile() });
|
||||
return;
|
||||
}
|
||||
|
||||
let enabled = currentLint.enabled;
|
||||
if (subAction === "enable" || subAction === "on" || subAction === "true") {
|
||||
enabled = true;
|
||||
} else if (subAction === "disable" || subAction === "off" || subAction === "false") {
|
||||
enabled = false;
|
||||
}
|
||||
|
||||
const activeLinter = stringOption(args.options.linter) ?? currentLint.activeLinter;
|
||||
const minScore = args.options.minScore !== undefined || args.options["min-score"] !== undefined
|
||||
? Number(args.options.minScore ?? args.options["min-score"])
|
||||
: currentLint.minScore;
|
||||
|
||||
const nextLint = {
|
||||
enabled,
|
||||
activeLinter,
|
||||
minScore: isNaN(minScore) ? 0 : Math.max(0, Math.min(100, minScore))
|
||||
};
|
||||
|
||||
const config = saveGlobalConfig({
|
||||
...previousConfig,
|
||||
lint: nextLint
|
||||
});
|
||||
|
||||
printJson(globalConfigSummary(config));
|
||||
return;
|
||||
}
|
||||
|
||||
throw new Error(`Unknown config command: ${action ?? ""}. Available: paths, get, status, mode, lint. Run 'seal-use help' for available commands.`);
|
||||
}
|
||||
@@ -140,5 +140,24 @@ export async function handleRulesCommand(
|
||||
return;
|
||||
}
|
||||
|
||||
throw new Error(`Unknown rules command: ${action ?? ""}. Run 'seal-use help' for available commands.`);
|
||||
if (action === "lint") {
|
||||
await runTool(
|
||||
"seal_approval_rules_lint",
|
||||
client,
|
||||
corp,
|
||||
{
|
||||
linter: stringOption(args.options.linter),
|
||||
version: stringOption(args.options.version),
|
||||
code: stringOption(args.options.code),
|
||||
ruleId: stringOption(args.options.rule) ?? maybeName,
|
||||
minScore: numberOption(args.options.minScore) ?? numberOption(args.options["min-score"]),
|
||||
level: stringOption(args.options.level),
|
||||
summary: booleanOption(args.options.summary)
|
||||
},
|
||||
outputOptions(args.options)
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
throw new Error(`Unknown rules command: ${action ?? ""}. Available: count, list, clear, versions, version, get, search, lint. Run 'seal-use help' for available commands.`);
|
||||
}
|
||||
Reference in new issue
Block a user