diff options
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | doc/conform.txt | 1 | ||||
-rw-r--r-- | lua/conform/formatters/opa_fmt.lua | 9 |
3 files changed, 11 insertions, 0 deletions
@@ -242,6 +242,7 @@ You can view this list in vim with `:help conform-formatters` - [nixfmt](https://github.com/serokell/nixfmt) - nixfmt is a formatter for Nix code, intended to apply a uniform style. - [nixpkgs_fmt](https://github.com/nix-community/nixpkgs-fmt) - nixpkgs-fmt is a Nix code formatter for nixpkgs. - [ocamlformat](https://github.com/ocaml-ppx/ocamlformat) - Auto-formatter for OCaml code. +- [opa_fmt](https://www.openpolicyagent.org/docs/latest/cli/#opa-fmt) - Format Rego files using `opa fmt` command. - [packer_fmt](https://developer.hashicorp.com/packer/docs/commands/fmt) - The packer fmt Packer command is used to format HCL2 configuration files to a canonical format and style. - [pangu](https://github.com/vinta/pangu.py) - Insert whitespace between CJK and half-width characters. - [perlimports](https://github.com/perl-ide/App-perlimports) - Make implicit Perl imports explicit. diff --git a/doc/conform.txt b/doc/conform.txt index c9b929f..ad2c736 100644 --- a/doc/conform.txt +++ b/doc/conform.txt @@ -265,6 +265,7 @@ FORMATTERS *conform-formatter style. `nixpkgs_fmt` - nixpkgs-fmt is a Nix code formatter for nixpkgs. `ocamlformat` - Auto-formatter for OCaml code. +`opa_fmt` - Format Rego files using `opa fmt` command. `packer_fmt` - The packer fmt Packer command is used to format HCL2 configuration files to a canonical format and style. `pangu` - Insert whitespace between CJK and half-width characters. diff --git a/lua/conform/formatters/opa_fmt.lua b/lua/conform/formatters/opa_fmt.lua new file mode 100644 index 0000000..b4f95dd --- /dev/null +++ b/lua/conform/formatters/opa_fmt.lua @@ -0,0 +1,9 @@ +---@type conform.FileFormatterConfig +return { + meta = { + url = "https://www.openpolicyagent.org/docs/latest/cli/#opa-fmt", + description = "Format Rego files using `opa fmt` command.", + }, + command = "opa", + args = { "fmt" }, +} |