mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 10:16:44 +00:00
fix(clawsweeper): address review for automerge-openclaw-openclaw-84385 (validation-1)
This commit is contained in:
@@ -67,9 +67,7 @@ export function shouldSkipAppLintForMissingSwiftlint(options = {}) {
|
||||
const env = options.env ?? process.env;
|
||||
const platform = options.platform ?? process.platform;
|
||||
const swiftlintAvailable = options.swiftlintAvailable ?? executableExistsOnPath("swiftlint", env);
|
||||
return (
|
||||
isTruthyEnvFlag(env.OPENCLAW_TESTBOX_REMOTE_RUN) && platform !== "darwin" && !swiftlintAvailable
|
||||
);
|
||||
return platform !== "darwin" && !swiftlintAvailable;
|
||||
}
|
||||
|
||||
export function shouldDelegateChangedCheckToCrabbox(argv = [], env = process.env) {
|
||||
@@ -231,11 +229,11 @@ export function createChangedCheckPlan(result, options = {}) {
|
||||
}
|
||||
if (lanes.apps && shouldSkipAppLintForMissingSwiftlint({ ...options, env: baseEnv })) {
|
||||
addCommand(
|
||||
"lint apps (swiftlint unavailable in Testbox)",
|
||||
"lint apps (swiftlint unavailable on this host)",
|
||||
"node",
|
||||
[
|
||||
"-e",
|
||||
"console.error('[check:changed] Swift app lint skipped: swiftlint is unavailable in this Linux Testbox; macOS CI owns SwiftLint coverage.')",
|
||||
"console.error('[check:changed] Swift app lint skipped: swiftlint is unavailable on this non-macOS host; macOS CI owns SwiftLint coverage.')",
|
||||
],
|
||||
baseEnv,
|
||||
);
|
||||
|
||||
@@ -865,12 +865,12 @@ describe("scripts/changed-lanes", () => {
|
||||
expect(plan.commands.map((command) => command.args[0])).not.toContain("tsgo:all");
|
||||
});
|
||||
|
||||
it("keeps app lint explicit when Linux Testbox lacks SwiftLint", () => {
|
||||
it("keeps app lint explicit when non-macOS hosts lack SwiftLint", () => {
|
||||
const result = detectChangedLanes([
|
||||
"apps/shared/OpenClawKit/Sources/OpenClawProtocol/GatewayModels.swift",
|
||||
]);
|
||||
const plan = createChangedCheckPlan(result, {
|
||||
env: { OPENCLAW_TESTBOX_REMOTE_RUN: "1", PATH: "/usr/bin" },
|
||||
env: { PATH: "/usr/bin" },
|
||||
platform: "linux",
|
||||
swiftlintAvailable: false,
|
||||
});
|
||||
@@ -881,7 +881,7 @@ describe("scripts/changed-lanes", () => {
|
||||
expect(plan.commands.map((command) => command.args[0])).not.toContain("lint:apps");
|
||||
expect(plan.commands).toContainEqual(
|
||||
expect.objectContaining({
|
||||
name: "lint apps (swiftlint unavailable in Testbox)",
|
||||
name: "lint apps (swiftlint unavailable on this host)",
|
||||
bin: "node",
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user