mirror of
https://github.com/sst/opencode.git
synced 2025-07-07 16:14:59 +00:00
feat(formatter): Add detekt as Kotlin formatter
detekt [1] can be used as a wrapper for ktlint [2]. When using detekt as a formatter, the ktlint CLI is not required and might not be installed. To offer formatting in this case, define `detekt --auto-format` as formatter for Kotlin source files. [1]: https://detekt.dev [2]: https://detekt.dev/docs/rules/formatting
This commit is contained in:
parent
75a21ba3ce
commit
4a29e660b2
1 changed files with 9 additions and 0 deletions
|
@ -114,6 +114,15 @@ export const clang: Info = {
|
|||
},
|
||||
}
|
||||
|
||||
export const detekt: Info = {
|
||||
name: "detekt",
|
||||
command: ["detekt", "-ac", "-i", "$FILE"],
|
||||
extensions: [".kt", ".kts"],
|
||||
async enabled() {
|
||||
return Bun.which("detekt") !== null
|
||||
},
|
||||
}
|
||||
|
||||
export const ktlint: Info = {
|
||||
name: "ktlint",
|
||||
command: ["ktlint", "-F", "$FILE"],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue