diff options
author | Marcus Fernandes <marcusbfs@gmail.com> | 2024-05-09 23:52:22 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-09 20:52:22 -0600 |
commit | 6207f41e8f3813d72ef4499a8132c11d8baabe9f (patch) | |
tree | c402673c61ee3fca153290a71ce46febbddc8646 | |
parent | 6dc1603ea408f476a57937bbeaf7f86520a21a98 (diff) |
feat: add ormolu formatter for Haskell (#377) (#397)
* feat: add ormolu formatter for Haskell (#377)
* add ormolu references to README.md and doc/conform.txt
* revert wrong auto typo fix by codespell
* update meta field in the formatter
* doc: typo
---------
Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | doc/conform.txt | 4 | ||||
-rw-r--r-- | lua/conform/formatters/fourmolu.lua | 2 | ||||
-rw-r--r-- | lua/conform/formatters/ormolu.lua | 10 |
4 files changed, 16 insertions, 3 deletions
@@ -219,7 +219,8 @@ You can view this list in vim with `:help conform-formatters` - [fish_indent](https://fishshell.com/docs/current/cmds/fish_indent.html) - Indent or otherwise prettify a piece of fish code. - [fixjson](https://github.com/rhysd/fixjson) - JSON Fixer for Humans using (relaxed) JSON5. - [fnlfmt](https://git.sr.ht/~technomancy/fnlfmt) - A formatter for Fennel code. -- [fourmolu](https://hackage.haskell.org/package/fourmolu) - Fourmolu is a formatter for Haskell source code. +- [ormolu](https://hackage.haskell.org/package/ormolu) - A formatter for Haskell source code. +- [fourmolu](https://hackage.haskell.org/package/fourmolu) - A fourk of ormolu that uses four space indentation and allows arbitrary configuration. - [gci](https://github.com/daixiang0/gci) - GCI, a tool that controls Go package import order and makes it always deterministic. - [gdformat](https://github.com/Scony/godot-gdscript-toolkit) - A formatter for Godot's gdscript. - [gersemi](https://github.com/BlankSpruce/gersemi) - A formatter to make your CMake code the real treasure. diff --git a/doc/conform.txt b/doc/conform.txt index 977a0f0..2a406d9 100644 --- a/doc/conform.txt +++ b/doc/conform.txt @@ -233,7 +233,9 @@ FORMATTERS *conform-formatter `fish_indent` - Indent or otherwise prettify a piece of fish code. `fixjson` - JSON Fixer for Humans using (relaxed) JSON5. `fnlfmt` - A formatter for Fennel code. -`fourmolu` - Fourmolu is a formatter for Haskell source code. +`ormolu` - A formatter for Haskell source code. +`fourmolu` - A fourk of ormolu that uses four space indentation and allows + arbitrary configuration `gci` - GCI, a tool that controls Go package import order and makes it always deterministic. `gdformat` - A formatter for Godot's gdscript. diff --git a/lua/conform/formatters/fourmolu.lua b/lua/conform/formatters/fourmolu.lua index 9c64999..4e1db8e 100644 --- a/lua/conform/formatters/fourmolu.lua +++ b/lua/conform/formatters/fourmolu.lua @@ -2,7 +2,7 @@ return { meta = { url = "https://hackage.haskell.org/package/fourmolu", - description = "Fourmolu is a formatter for Haskell source code.", + description = "A fork of ormolu that uses four space indentation and allows arbitrary configuration.", }, command = "fourmolu", args = { "--stdin-input-file", "$FILENAME" }, diff --git a/lua/conform/formatters/ormolu.lua b/lua/conform/formatters/ormolu.lua new file mode 100644 index 0000000..4c36929 --- /dev/null +++ b/lua/conform/formatters/ormolu.lua @@ -0,0 +1,10 @@ +---@type conform.FileFormatterConfig +return { + meta = { + url = "https://hackage.haskell.org/package/ormolu", + description = "A formatter for Haskell source code.", + }, + command = "ormolu", + args = { "--stdin-input-file", "$FILENAME" }, + stdin = true, +} |