diff options
author | Nam Anh Pham Hoang <87260283+phnaharris@users.noreply.github.com> | 2024-05-22 19:11:35 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-22 05:11:35 -0700 |
commit | 18a3fa45d841c941399b4559ef60b39f2e3ded7c (patch) | |
tree | ac9108aa9f72ba99347e0baa6b671a0ba01fd162 | |
parent | 55619bcb306a1a37d487ed31b360a41c343ee74a (diff) |
feat: add forge_fmt formatter support for solidity filetype (#417)
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | doc/conform.txt | 2 | ||||
-rw-r--r-- | lua/conform/formatters/forge_fmt.lua | 10 |
3 files changed, 13 insertions, 0 deletions
@@ -221,6 +221,7 @@ You can view this list in vim with `:help conform-formatters` - [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) - A fork of ormolu that uses four space indentation and allows arbitrary configuration. +- [forge_fmt](https://github.com/foundry-rs/foundry) - Forge is a command-line tool that ships with Foundry. Forge tests, builds, and deploys your smart contracts. - [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 7d5a0e8..4db7599 100644 --- a/doc/conform.txt +++ b/doc/conform.txt @@ -236,6 +236,8 @@ FORMATTERS *conform-formatter `fnlfmt` - A formatter for Fennel code. `fourmolu` - A fork of ormolu that uses four space indentation and allows arbitrary configuration. +`forge_fmt` - Forge is a command-line tool that ships with Foundry. Forge tests, + builds, and deploys your smart contracts. `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/forge_fmt.lua b/lua/conform/formatters/forge_fmt.lua new file mode 100644 index 0000000..c6bdafb --- /dev/null +++ b/lua/conform/formatters/forge_fmt.lua @@ -0,0 +1,10 @@ +---@type conform.FileFormatterConfig +return { + meta = { + url = "https://github.com/foundry-rs/foundry", + description = "Forge is a command-line tool that ships with Foundry. Forge tests, builds, and deploys your smart contracts.", + }, + command = "forge", + args = { "fmt", "$FILENAME" }, + stdin = false, +} |