package ocamlformat-lib

  1. Overview
  2. Docs
Auto-formatter for OCaml code

Install

Dune Dependency

Authors

Maintainers

Sources

ocamlformat-0.26.0.tbz
sha256=031494ab770cef10a8f6aa1cbeb5660e46c3aa6c0cd457b110fec859a75e877d
sha512=35c0131f04c2c8ceb94f0f400e4b56690405ddebb482aec0c9962163001d9fd5b593455df08b508394949f2740ba28f1714dff9e1f17b618bdec62fd26fae281

Description

OCamlFormat is a tool to automatically format OCaml code in a uniform style.

Published: 20 Jul 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.26.0

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 (18)

  1. camlp-streams
  2. result
  3. astring
  4. csexp >= "1.4.0"
  5. uutf >= "1.0.1"
  6. uuseg >= "10.0.0"
  7. stdio
  8. ocaml-version >= "3.5.0"
  9. menhirSdk >= "20201216"
  10. menhirLib >= "20201216"
  11. menhir >= "20201216"
  12. fpath
  13. fix
  14. either
  15. dune-build-info
  16. dune >= "2.8"
  17. base >= "v0.12.0"
  18. ocaml >= "4.08" & < "5.2"

Dev Dependencies (4)

  1. odoc with-doc
  2. ocp-indent with-test = "false" & >= "1.8.0" | with-test & >= "1.8.1"
  3. ocamlformat-rpc-lib with-test & = version
  4. alcotest with-test & >= "1.3.0"

Used by (1)

  1. ocamlformat = "0.26.0"

Conflicts

None

OCaml

Innovation. Community. Security.