package ocamlformat-lib
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=dc8f2a330ca3930b36cacb2623bb360ed8bdf6e4a8acd293dbd9e2241a6fd33d
sha512=b28f545425fb5375447c90022d065dc7fd51ed2f66d8c1f65a71a6ad2465d039a8686e8f18249e5ad3a2362fee6149c855ef30eb45fb9d06d743a53d26b3e26f
Description
OCamlFormat is a tool to automatically format OCaml code in a uniform style.
Published: 06 Mar 2023
README
README.md
๐จ ocamlformat
ocamlformat is a tool for formatting OCaml code. It automatically adjusts the layout of your code to follow the recommended style guidelines, making it easier to read and understand.
๐ Installation
To use ocamlformat, you will need to have OCaml and opam (the OCaml package manager) installed on your system.
Once you have these dependencies, installation is a breeze! Just run the following command:
opam install ocamlformat
๐ป Usage
Formatting your code with ocamlformat is super simple! Just run the following command:
ocamlformat file.ml
You can also specify a configuration file to customize the formatting behavior of ocamlformat. To set up your project to use the default profile and the ocamlformat version you installed let's create a configuration file named .ocamlformat
containing:
profile = default
version = 0.25.1
For more information on configuration options, check out the documentation or run ocamlformat --help
.
The most convenient way to format your code is through the dune
build system. Just run the following command:
dune fmt
๐ค Contributing
We welcome contributions to ocamlformat! If you find a bug or want to suggest a feature, please open an issue on the GitHub repository. If you want to contribute code, please follow the contributing guidelines and open a pull request.
๐ License
ocamlformat is released under the MIT License.
Dependencies (19)
- camlp-streams
- result
- astring
-
csexp
>= "1.4.0"
-
uutf
>= "1.0.1"
-
uuseg
>= "10.0.0"
- stdio
-
ocp-indent
>= "1.8.0"
-
ocaml-version
>= "3.5.0"
-
menhirSdk
>= "20201216"
-
menhirLib
>= "20201216"
-
menhir
>= "20201216"
- fpath
- fix
- either
- dune-build-info
-
dune
>= "2.8"
-
base
>= "v0.12.0"
-
ocaml
>= "4.08" & < "5.2"
Dev Dependencies (3)
-
odoc
with-doc
-
ocamlformat-rpc-lib
with-test & = version
-
alcotest
with-test & >= "1.3.0"
Used by (1)
-
ocamlformat
= "0.25.1"
Conflicts
None