Skip to content

Commit

Permalink
feat: add ocp-indent for OCaml formatting (#335)
Browse files Browse the repository at this point in the history
  • Loading branch information
NickHu committed Mar 18, 2024
1 parent 0a530b3 commit 551d02f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,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.
- [ocp-indent](https://github.com/ocaml-ppx/ocamlformat) - Automatic indentation of OCaml source files.
- [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.
Expand Down
1 change: 1 addition & 0 deletions doc/conform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ FORMATTERS *conform-formatter
style.
`nixpkgs_fmt` - nixpkgs-fmt is a Nix code formatter for nixpkgs.
`ocamlformat` - Auto-formatter for OCaml code.
`ocp-indent` - Automatic indentation of OCaml source files.
`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.
Expand Down
8 changes: 8 additions & 0 deletions lua/conform/formatters/ocp-indent.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---@type conform.FileFormatterConfig
return {
meta = {
url = "https://github.com/OCamlPro/ocp-indent",
description = "Automatic indentation of OCaml source files.",
},
command = "ocp-indent",
}

0 comments on commit 551d02f

Please sign in to comment.