mirror of
https://github.com/sst/opencode.git
synced 2025-08-04 13:30:52 +00:00
add zig, python, clang, and kotlin formatters
Co-authored-by: Suhas-Koheda <Suhas-Koheda@users.noreply.github.com> Co-authored-by: Polo123456789 <Polo123456789@users.noreply.github.com> Co-authored-by: theodore-s-beers <theodore-s-beers@users.noreply.github.com> Co-authored-by: TylerHillery <TylerHillery@users.noreply.github.com>
This commit is contained in:
parent
0f41e60bd6
commit
463257e7e4
1 changed files with 50 additions and 0 deletions
|
@ -74,3 +74,53 @@ export const prettier: Definition = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const zig: Definition = {
|
||||||
|
name: "zig",
|
||||||
|
command: ["zig", "fmt", "$FILE"],
|
||||||
|
extensions: [".zig", ".zon"],
|
||||||
|
async enabled() {
|
||||||
|
return Bun.which("zig") !== null
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
export const clang: Definition = {
|
||||||
|
name: "clang-format",
|
||||||
|
command: ["clang-format", "-i", "$FILE"],
|
||||||
|
extensions: [
|
||||||
|
".c",
|
||||||
|
".cc",
|
||||||
|
".cpp",
|
||||||
|
".cxx",
|
||||||
|
".c++",
|
||||||
|
".h",
|
||||||
|
".hh",
|
||||||
|
".hpp",
|
||||||
|
".hxx",
|
||||||
|
".h++",
|
||||||
|
".ino",
|
||||||
|
".C",
|
||||||
|
".H",
|
||||||
|
],
|
||||||
|
async enabled() {
|
||||||
|
return Bun.which("clang-format") !== null
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
export const ktlint: Definition = {
|
||||||
|
name: "ktlint",
|
||||||
|
command: ["ktlint", "-F", "$FILE"],
|
||||||
|
extensions: [".kt", ".kts"],
|
||||||
|
async enabled() {
|
||||||
|
return Bun.which("ktlint") !== null
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
export const ruff: Definition = {
|
||||||
|
name: "ruff",
|
||||||
|
command: ["ruff", "format", "$FILE"],
|
||||||
|
extensions: [".py", ".pyi"],
|
||||||
|
async enabled() {
|
||||||
|
return Bun.which("ruff") !== null
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue