feat: add shfmt formatter for shell scripts (#6204)
This commit is contained in:
parent
8416db03ef
commit
b0e4408ecf
2 changed files with 10 additions and 0 deletions
|
|
@ -313,3 +313,12 @@ export const gleam: Info = {
|
||||||
return Bun.which("gleam") !== null
|
return Bun.which("gleam") !== null
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const shfmt: Info = {
|
||||||
|
name: "shfmt",
|
||||||
|
command: ["shfmt", "-w", "$FILE"],
|
||||||
|
extensions: [".sh", ".bash"],
|
||||||
|
async enabled() {
|
||||||
|
return Bun.which("shfmt") !== null
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ OpenCode comes with several built-in formatters for popular languages and framew
|
||||||
| ocamlformat | .ml, .mli | `ocamlformat` command available and `.ocamlformat` config file |
|
| ocamlformat | .ml, .mli | `ocamlformat` command available and `.ocamlformat` config file |
|
||||||
| terraform | .tf, .tfvars | `terraform` command available |
|
| terraform | .tf, .tfvars | `terraform` command available |
|
||||||
| gleam | .gleam | `gleam` command available |
|
| gleam | .gleam | `gleam` command available |
|
||||||
|
| shfmt | .sh, .bash | `shfmt` command available |
|
||||||
| oxfmt (Experimental) | .js, .jsx, .ts, .tsx | `oxfmt` dependency in `package.json` and an [experimental env variable flag](/docs/cli/#experimental) |
|
| oxfmt (Experimental) | .js, .jsx, .ts, .tsx | `oxfmt` dependency in `package.json` and an [experimental env variable flag](/docs/cli/#experimental) |
|
||||||
|
|
||||||
So if your project has `prettier` in your `package.json`, OpenCode will automatically use it.
|
So if your project has `prettier` in your `package.json`, OpenCode will automatically use it.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue