diff options
author | Mads Hougesen <madshougesen@gmail.com> | 2024-03-18 18:48:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-18 10:48:07 -0700 |
commit | f8c64b835f60a80639375500a80e8cd303d8eda6 (patch) | |
tree | 4d00dfac32b168c97137668b8560194da507b367 | |
parent | 220988eba89a877ceffae9eb63940a0d83c762ca (diff) |
feat: support crystal tool format (#344)
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | doc/conform.txt | 1 | ||||
-rw-r--r-- | lua/conform/formatters/crystal.lua | 10 |
3 files changed, 12 insertions, 0 deletions
@@ -201,6 +201,7 @@ You can view this list in vim with `:help conform-formatters` - [cljstyle](https://github.com/greglook/cljstyle) - Formatter for Clojure code. - [cmake_format](https://github.com/cheshirekow/cmake_format) - Parse cmake listfiles and format them nicely. - [codespell](https://github.com/codespell-project/codespell) - Check code for common misspellings. +- [crystal](https://crystal-lang.org/) - Format Crystal code. - [csharpier](https://github.com/belav/csharpier) - The opinionated C# code formatter. - [cue_fmt](https://cuelang.org) - Format CUE files using `cue fmt` command. - [darker](https://github.com/akaihola/darker) - Run black only on changed lines. diff --git a/doc/conform.txt b/doc/conform.txt index d0ffda2..fb3ff77 100644 --- a/doc/conform.txt +++ b/doc/conform.txt @@ -208,6 +208,7 @@ FORMATTERS *conform-formatter `cljstyle` - Formatter for Clojure code. `cmake_format` - Parse cmake listfiles and format them nicely. `codespell` - Check code for common misspellings. +`crystal`- Format Crystal code. `csharpier` - The opinionated C# code formatter. `cue_fmt` - Format CUE files using `cue fmt` command. `darker` - Run black only on changed lines. diff --git a/lua/conform/formatters/crystal.lua b/lua/conform/formatters/crystal.lua new file mode 100644 index 0000000..1f9e12b --- /dev/null +++ b/lua/conform/formatters/crystal.lua @@ -0,0 +1,10 @@ +---@type conform.FileFormatterConfig +return { + meta = { + url = "https://crystal-lang.org/", + description = "Format Crystal code.", + }, + command = "crystal", + args = { "tool", "format", "-" }, + stdin = true, +} |