chore: migrate to oxlint and oxfmt

Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
Peter Steinberger
2026-01-14 14:31:43 +00:00
parent 912ebffc63
commit c379191f80
1480 changed files with 28608 additions and 43547 deletions

View File

@@ -6,9 +6,7 @@ import type { WizardPrompter } from "../wizard/prompts.js";
import { detectBinary, resolveNodeManagerOptions } from "./onboard-helpers.js";
function summarizeInstallFailure(message: string): string | undefined {
const cleaned = message
.replace(/^Install failed(?:\s*\([^)]*\))?\s*:?\s*/i, "")
.trim();
const cleaned = message.replace(/^Install failed(?:\s*\([^)]*\))?\s*:?\s*/i, "").trim();
if (!cleaned) return undefined;
const maxLen = 140;
return cleaned.length > maxLen ? `${cleaned.slice(0, maxLen - 1)}` : cleaned;
@@ -20,13 +18,10 @@ function formatSkillHint(skill: {
}): string {
const desc = skill.description?.trim();
const installLabel = skill.install[0]?.label?.trim();
const combined =
desc && installLabel ? `${desc}${installLabel}` : desc || installLabel;
const combined = desc && installLabel ? `${desc}${installLabel}` : desc || installLabel;
if (!combined) return "install";
const maxLen = 90;
return combined.length > maxLen
? `${combined.slice(0, maxLen - 1)}`
: combined;
return combined.length > maxLen ? `${combined.slice(0, maxLen - 1)}` : combined;
}
function upsertSkillEntry(
@@ -54,16 +49,12 @@ export async function setupSkills(
): Promise<ClawdbotConfig> {
const report = buildWorkspaceSkillStatus(workspaceDir, { config: cfg });
const eligible = report.skills.filter((s) => s.eligible);
const missing = report.skills.filter(
(s) => !s.eligible && !s.disabled && !s.blockedByAllowlist,
);
const missing = report.skills.filter((s) => !s.eligible && !s.disabled && !s.blockedByAllowlist);
const blocked = report.skills.filter((s) => s.blockedByAllowlist);
const needsBrewPrompt =
process.platform !== "win32" &&
report.skills.some((skill) =>
skill.install.some((option) => option.kind === "brew"),
) &&
report.skills.some((skill) => skill.install.some((option) => option.kind === "brew")) &&
!(await detectBinary("brew"));
await prompter.note(
@@ -140,9 +131,7 @@ export async function setupSkills(
],
});
const selected = (toInstall as string[]).filter(
(name) => name !== "__skip__",
);
const selected = (toInstall as string[]).filter((name) => name !== "__skip__");
for (const name of selected) {
const target = installable.find((s) => s.name === name);
if (!target || target.install.length === 0) continue;
@@ -160,14 +149,10 @@ export async function setupSkills(
} else {
const code = result.code == null ? "" : ` (exit ${result.code})`;
const detail = summarizeInstallFailure(result.message);
spin.stop(
`Install failed: ${name}${code}${detail ? `${detail}` : ""}`,
);
spin.stop(`Install failed: ${name}${code}${detail ? `${detail}` : ""}`);
if (result.stderr) runtime.log(result.stderr.trim());
else if (result.stdout) runtime.log(result.stdout.trim());
runtime.log(
"Tip: run `clawdbot doctor` to review skills + requirements.",
);
runtime.log("Tip: run `clawdbot doctor` to review skills + requirements.");
runtime.log("Docs: https://docs.clawd.bot/skills");
}
}