Skip to content

Commit 334161a

Browse files
feat: add elixir file formatting (anomalyco#458)
1 parent dbb6e55 commit 334161a

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

packages/opencode/src/format/index.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,5 +132,32 @@ export namespace Format {
132132
}
133133
},
134134
},
135+
{
136+
name: "mix format",
137+
command: ["mix", "format", "$FILE"],
138+
extensions: [
139+
".ex",
140+
".exs",
141+
".eex",
142+
".heex",
143+
".leex",
144+
".neex",
145+
".sface",
146+
],
147+
async enabled() {
148+
try {
149+
const proc = Bun.spawn({
150+
cmd: ["mix", "--version"],
151+
cwd: App.info().path.cwd,
152+
stdout: "ignore",
153+
stderr: "ignore",
154+
})
155+
const exit = await proc.exited
156+
return exit === 0
157+
} catch {
158+
return false
159+
}
160+
},
161+
},
135162
]
136163
}

0 commit comments

Comments
 (0)