package ocamlformat
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=2a1817f6bc581ff0cce9f0aa9687b897b02726e2ab75749ee98d57637057332d
sha512=db47f843bfc5a438d43f7c482cde86bd13f05a6825e2a0afa80614b651a88ae8b3805cca45da6bcf9189e741e0c79d38652b0bc47efe636c1502a66676dcb28e
Description
OCamlFormat is a tool to automatically format OCaml code in a uniform style.
Published: 28 Feb 2022
README
README.md
OCamlFormat
Hello, new user! Welcome! :wave:
If you are here, you are probably interested in using a formatting tool for your code base, so that you do not have to worry about formatting it by hand, and to speed up code review by focusing on the important parts.
OCamlFormat is probably what you are after!
OCamlFormat works by parsing then outputting again the same OCaml source file in a consistent style.
Getting started
Installation
OCamlFormat can be installed with opam
:
opam install ocamlformat
Alternatively, see ocamlformat.opam
for manual build instructions.
Formatting code!
Setting up your project to use the default profile and the OCamlFormat version you installed (hopefully the last one) in this .ocamlformat
file is considered good practice:
profile = default
version = 0.21.0
To manually invoke OCamlformat the general command is:
ocamlformat [OPTION]... [SRC]...
See ocamlformat --help
or man ocamlformat
for the detail about options.
You can also view it online.
The most common usecase involves using the dune
build system, once your project is correctly setup (see Dune's manual) you can reformat your project using:
dune build @fmt
Community
See CONTRIBUTING for how to help out.
License
OCamlFormat is MIT-licensed.
Dependencies (18)
-
uutf
>= "1.0.1"
-
uuseg
>= "10.0.0"
- stdio
-
re
>= "1.7.2"
-
odoc-parser
>= "1.0.0" & < "2.0.0"
- ocp-indent
-
ocaml-version
>= "3.3.0" & < "3.6.0"
-
menhirSdk
>= "20201216"
-
menhirLib
>= "20201216"
-
menhir
>= "20201216"
- fpath
- fix
- either
- dune-build-info
-
dune
>= "2.8"
-
cmdliner
>= "1.1.0"
-
base
>= "v0.12.0"
-
ocaml
>= "4.08" & < "4.15"
Used by (63)
- ask
- ask-integrator
- autofonce
- autofonce_config
- autofonce_core
- autofonce_lib
- autofonce_m4
- autofonce_misc
- autofonce_patch
- autofonce_share
- awsm-codegen
-
bastet
< "2.0.0"
- bitpack_serializer
- diff
-
diskuvbox
< "0.1.2"
- drom
- drom_lib
- drom_toml
- dump_ocamlformat
-
ez_cmdliner
>= "0.2.0"
-
ez_config
>= "0.2.0"
-
ez_file
>= "0.2.0"
-
ez_hash
< "0.5.3"
- ez_opam_file
- ez_search
- ez_subst
- fromager
- header-check
-
js_of_ocaml-webgpu
>= "0.2"
- jsoo-react
-
letters
>= "0.2.0" & != "0.3.1"
- melange-fest
-
melange-json
>= "1.2.0"
-
melange-radix-icons
>= "0.1.0"
- mlx
- module-graph
-
noCanren
>= "0.3.0~alpha1"
-
OCanren
>= "0.3.0"
-
OCanren-ppx
= "0.3.0~alpha1"
-
ocaml-lsp-server
< "1.8.0"
-
ocamlformat-rpc
= "0.21.0"
- ocp-search
-
ocplib_stuff
>= "0.3.0"
-
opam-bin
>= "0.9.5"
-
opam_bin_lib
>= "0.9.5"
-
owi
>= "0.2"
- polars
- polars_async
- ppx_deriving_jsonschema
-
psmt2-frontend
>= "0.3.0"
-
rea
< "0.2.0"
- red-black-tree
-
scaml
>= "1.2.0"
-
sihl
< "0.1.0"
- solidity-alcotest
- solidity-common
- solidity-parser
- solidity-test
- solidity-typechecker
-
spotify_ml
>= "push"
- styled-ppx
-
tezt
>= "3.1.0" & < "4.1.0"
-
yocaml
>= "2.0.0"
Conflicts
None