aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandros Alexiou <alex.alexiouu@gmail.com>2024-05-06 21:09:13 +0300
committerGitHub <noreply@github.com>2024-05-06 11:09:13 -0700
commitb72f650206ddfeadd6c7df0f775a928e82ece353 (patch)
tree473ad3f477e6932a379a9f91faeae8ff5709e34f
parent3cd1135cb2978c9d45b8dc6afc80045fb8a93157 (diff)
feat: add ktfmt formatter for Kotlin (#392)
-rw-r--r--README.md1
-rw-r--r--doc/conform.txt2
-rw-r--r--lua/conform/formatters/ktfmt.lua9
3 files changed, 12 insertions, 0 deletions
diff --git a/README.md b/README.md
index 6d40463..949972c 100644
--- a/README.md
+++ b/README.md
@@ -240,6 +240,7 @@ You can view this list in vim with `:help conform-formatters`
- [jq](https://github.com/stedolan/jq) - Command-line JSON processor.
- [jsonnetfmt](https://github.com/google/go-jsonnet/tree/master/cmd/jsonnetfmt) - jsonnetfmt is a command line tool to format jsonnet files.
- [just](https://github.com/casey/just) - Format Justfile.
+- [ktfmt](https://github.com/facebook/ktfmt) - A program that reformats Kotlin source code to comply with the common community standard for Kotlin code conventions.
- [ktlint](https://ktlint.github.io/) - An anti-bikeshedding Kotlin linter with built-in formatter.
- [latexindent](https://github.com/cmhughes/latexindent.pl) - A perl script for formatting LaTeX files that is generally included in major TeX distributions.
- [liquidsoap-prettier](https://github.com/savonet/liquidsoap-prettier) - A binary to format Liquidsoap scripts
diff --git a/doc/conform.txt b/doc/conform.txt
index 034acdf..dd91234 100644
--- a/doc/conform.txt
+++ b/doc/conform.txt
@@ -262,6 +262,8 @@ FORMATTERS *conform-formatter
`jq` - Command-line JSON processor.
`jsonnetfmt` - jsonnetfmt is a command line tool to format jsonnet files.
`just` - Format Justfile.
+`ktfmt` - A program that reformats Kotlin source code to comply with the common
+ community standard for Kotlin code conventions.
`ktlint` - An anti-bikeshedding Kotlin linter with built-in formatter.
`latexindent` - A perl script for formatting LaTeX files that is generally
included in major TeX distributions.
diff --git a/lua/conform/formatters/ktfmt.lua b/lua/conform/formatters/ktfmt.lua
new file mode 100644
index 0000000..7be580b
--- /dev/null
+++ b/lua/conform/formatters/ktfmt.lua
@@ -0,0 +1,9 @@
+---@type conform.FileFormatterConfig
+return {
+ meta = {
+ url = "https://github.com/facebook/ktfmt",
+ description = "Reformats Kotlin source code to comply with the common community standard conventions.",
+ },
+ command = "ktfmt",
+ args = { "-" },
+}