package ocamlformat
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=2e4f596bf7aa367a844fe83ba0f6b0bf14b2a65179ddc082363fe9793d0375c5
sha512=b03d57462e65b11aa9f78dd5c4548251e8d1c5a1c9662f7502bdb10472aeb9df33c1d407350767a5223fbff9c01d53de85bafacd0274b49abc4b43701b159bee
Description
ocamlformat is a code formatter for OCaml. It comes with opinionated default settings but is also fully customizable to suit your coding style.
- Profiles: ocamlformat offers profiles we predefined formatting configurations. Profiles include
default
,ocamlformat
,janestreet
. - Configurable: Users can change the formatting profile and configure every option in their
.ocamlformat
configuration file. - Format Comments: ocamlformat can format comments, docstrings, and even code blocks in your comments.
- RPC: ocamlformat provides an RPC server that can be used by other tools to easily format OCaml Code.
Published: 23 Apr 2024
README
README.md
ocamlformat
OCaml Code Formatter.
ocamlformat is a code formatter for OCaml. It comes with opinionated default settings but is also fully customizable to suit your coding style.
Profiles: ocamlformat offers profiles we predefined formatting configurations. Profiles include
default
,ocamlformat
,janestreet
.Configurable: Users can change the formatting profile and configure every option in their
.ocamlformat
configuration file.Format Comments: ocamlformat can format comments, docstrings, and even code blocks in your comments.
RPC: ocamlformat provides an RPC server that can bed used by other tools to easily format OCaml Code.
ocamlformat is part of the OCaml Platform, the recommended set of tools for OCaml.
Getting Started
Installation
To use ocamlformat, you will need OCaml and opam (the OCaml package manager) installed on your system. Visit the OCaml.org installation page for instructions.
With OCaml and opam installed, you can install ocamlformat with:
opam install ocamlformat
Usage
Formatting your code is as easy as running:
ocamlformat file.ml
To configure ocamlformat to your liking, create an .ocamlformat
configuration file in your project with settings like:
profile = default
version = 0.26.2
Refer to our documentation or use ocamlformat --help
for a full list of configuration options.
To make formatting your code even easier, use the dune
build system:
dune fmt
Documentation
The full documentation for ocamlformat, including comprehensive user and API guides, can be found on OCaml.org.
Contributing
Contributing Guide
We wholeheartedly welcome contributors! To start, please read our Contributing Guide to familiarize yourself with our development process, including how to propose and how to start hacking on ocamlformat.
Hacking Guide
In addition to the Contributing Guide, we provide a Hacking Guide for ocamlformat developers. It contains in-depth explanation of development processes, such as running tests, releasing ocamlformat, etc.
Code of Conduct
In order to foster a welcoming and respectful community, ocamlformat has adopted the OCaml Code of Conduct.
Roadmap
Interested in the future of ocamlformat? Take a look at our Roadmap to understand our vision and planned advancements for ocamlformat.
Discussions
For conversations on ongoing development, be sure to visit the ocamlformat section of the OCaml Discuss forum.
License
ocamlformat is distributed under the terms of the MIT License. See the LICENSE file for complete details.
Acknowledgments
We gratefully acknowledge the individuals and organizations that have significantly contributed to ocamlformat.
ocamlformat owes its existance to its initial author, Josh Berdine. We also want to express our appreciation to Hugo Heuzard, Guillaume Petiot, and Jules Aguillon. Their significant contributions have been instrumental to the advancement of ocamlformat.
Moreover, our gratitude extends to Facebook, who fostered the inception of ocamlformat as part of their work on the ReasonML project. Jane Street and Tarides have also provided financial support and contributed to the ongoing development of the project.
Dependencies (4)
-
re
>= "1.10.3"
-
ocamlformat-lib
= version
-
dune
>= "2.8"
-
ocaml
>= "4.08"
Dev Dependencies (3)
-
odoc
with-doc
-
ocamlformat-rpc-lib
with-test & = version
-
cmdliner
with-test = "false" & >= "1.1.0" | with-test & >= "1.2.0"
Used by (73)
- 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
- coap
- coap-core
- coap-server-lwt
- 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
-
guardian
< "0.1.0"
- header-check
-
js_of_ocaml-webgpu
>= "0.2"
-
letters
>= "0.2.0" & != "0.3.1"
- melange-fest
-
melange-json
>= "1.2.0"
-
melange-radix-icons
>= "0.1.0"
- mlx
- module-graph
-
mqtt
>= "0.2.2"
-
noCanren
>= "0.3.0~alpha1"
-
OCanren-ppx
= "0.3.0~alpha1"
-
ocaml-lsp-server
< "1.8.0" | >= "1.18.0"
- ocp-search
-
ocplib_stuff
>= "0.3.0"
-
opam-bin
>= "0.9.5"
-
opam_bin_lib
>= "0.9.5"
-
owi
>= "0.2"
- passage
- polars
- polars_async
-
pp
>= "2.0.0"
- ppx_deriving_jsonschema
-
ppxlib
>= "0.33.1~5.3preview"
-
provider
>= "0.0.9"
-
psmt2-frontend
>= "0.3.0"
-
rea
< "0.2.0"
- red-black-tree
-
scaml
>= "1.2.0"
- signal
-
sihl
< "0.1.0"
-
slipshow
>= "0.0.33"
- solidity-alcotest
- solidity-common
- solidity-parser
- solidity-test
- solidity-typechecker
- spotify_ml
- sqids
- styled-ppx
- tabr
-
yocaml
>= "2.0.0"
- zanuda
Conflicts
None