Skip to content

Commit 6423ca6

Browse files
committed
feat(acq-kits): install OpenCode v2 in opencode kit
Update the opencode acq kit to install OpenCode v2 and switch markdownlint to an auditable CLI path.
1 parent f222741 commit 6423ca6

18 files changed

Lines changed: 696 additions & 643 deletions
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env node
2+
import { spawnSync } from "node:child_process";
3+
import { existsSync, readFileSync } from "node:fs";
4+
5+
function readList(section) {
6+
if (!existsSync(".markdownlint-cli2.yaml")) return [];
7+
const lines = readFileSync(".markdownlint-cli2.yaml", "utf8").split(/\r?\n/);
8+
const values = [];
9+
let active = false;
10+
for (const line of lines) {
11+
if (/^[A-Za-z][A-Za-z0-9_-]*:\s*$/.test(line)) {
12+
active = line.startsWith(`${section}:`);
13+
continue;
14+
}
15+
if (!active) continue;
16+
const match = line.match(/^\s*-\s+["']?(.+?)["']?\s*$/);
17+
if (match) values.push(match[1]);
18+
}
19+
return values;
20+
}
21+
22+
const globs = readList("globs");
23+
const patterns = globs.length ? globs : ["**/*.md"];
24+
const ignores = readList("ignores").flatMap((ignore) => ["--ignore", ignore]);
25+
const args = ["--config", ".markdownlint.jsonc", ...ignores, ...process.argv.slice(2), ...patterns];
26+
27+
console.error(`Linting: ${patterns.length} file pattern(s)`);
28+
const result = spawnSync("markdownlint", args, { stdio: "inherit" });
29+
process.exit(result.status ?? 1);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"name":"markdownlint-cli2","version":"0.0.0-local","private":true,"bin":{"markdownlint-cli2":"index.js"}}

0 commit comments

Comments
 (0)