Skip to content

Commit ec6222b

Browse files
committed
fix(init): address third round of PR review comments
- Fix lint-rule guard in init.go to use resolved 'tools' slice instead of 'initTools' global; 'initTools' is empty when --all-tools is used so the guard was ineffective, causing duplicate writes when both claude and opencode were selected via --all-tools - Nil out vsixData in runInit test helper and restore it via t.Cleanup to prevent installVSCodeExtension from invoking the external 'code' CLI or writing .vsix files on CI / dev machines - Update stale link text in opencode.md ('Cursor / Continue.dev / Windsurf') to match the renamed page heading ('Other AI tools')
1 parent c9220a8 commit ec6222b

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

cmd/mxcli/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ All tools receive universal documentation in AGENTS.md and .ai-context/
316316
// Only write lint rules from the OpenCode path when Claude is not also
317317
// being initialised — the Claude path already writes the same files to
318318
// .claude/lint-rules/ and we don't want duplicate log output or writes.
319-
if !slices.Contains(initTools, "claude") {
319+
if !slices.Contains(tools, "claude") {
320320
err = fs.WalkDir(lintRulesFS, "lint-rules", func(path string, d fs.DirEntry, err error) error {
321321
if err != nil {
322322
return err

cmd/mxcli/init_test.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,19 @@ import (
1010
)
1111

1212
// runInit is a test helper that sets initTools to the given list, invokes the
13-
// cobra Run closure against dir, then restores the original value.
13+
// cobra Run closure against dir, then restores the original values.
14+
// vsixData is set to nil during the call to prevent installVSCodeExtension from
15+
// invoking the external 'code' CLI or writing .vsix files on CI / dev machines.
1416
func runInit(t *testing.T, tools []string, dir string) {
1517
t.Helper()
16-
prev := initTools
17-
t.Cleanup(func() { initTools = prev })
18+
prevTools := initTools
19+
prevVsix := vsixData
20+
t.Cleanup(func() {
21+
initTools = prevTools
22+
vsixData = prevVsix
23+
})
1824
initTools = tools
25+
vsixData = nil // disable VS Code extension installation during tests
1926
initCmd.Run(initCmd, []string{dir})
2027
}
2128

docs-site/src/tutorial/opencode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,4 +192,4 @@ This creates `.opencode/`, `opencode.json`, and the lint rules without touching
192192

193193
## Next steps
194194

195-
To understand what the skill files contain and how they guide AI behavior, see [Skills and CLAUDE.md](skills.md). For other supported tools, see [Cursor / Continue.dev / Windsurf](other-ai-tools.md).
195+
To understand what the skill files contain and how they guide AI behavior, see [Skills and CLAUDE.md](skills.md). For other supported tools, see [Other AI tools (Cursor, Continue.dev, Windsurf, OpenCode)](other-ai-tools.md).

0 commit comments

Comments
 (0)