From 18a3fa45d841c941399b4559ef60b39f2e3ded7c Mon Sep 17 00:00:00 2001 From: Nam Anh Pham Hoang <87260283+phnaharris@users.noreply.github.com> Date: Wed, 22 May 2024 19:11:35 +0700 Subject: feat: add forge_fmt formatter support for solidity filetype (#417) --- README.md | 1 + doc/conform.txt | 2 ++ lua/conform/formatters/forge_fmt.lua | 10 ++++++++++ 3 files changed, 13 insertions(+) create mode 100644 lua/conform/formatters/forge_fmt.lua diff --git a/README.md b/README.md index 1dae5c5..63db3c5 100644 --- a/README.md +++ b/README.md @@ -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, +} -- cgit v1.2.3-70-g09d2