package ocamlformat
Build not checkedInstall
dune-project
Dependency
Authors
Maintainers
Sources
sha256=2a1817f6bc581ff0cce9f0aa9687b897b02726e2ab75749ee98d57637057332d
sha512=db47f843bfc5a438d43f7c482cde86bd13f05a6825e2a0afa80614b651a88ae8b3805cca45da6bcf9189e741e0c79d38652b0bc47efe636c1502a66676dcb28e
Description
OCamlFormat is a tool to automatically format OCaml code in a uniform style.
Added to opam-repository:
README
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 ocamlformatAlternatively, 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.0To 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 @fmtCommunity
- forum: https://discuss.ocaml.org/tags/ocamlformat
- github: https://github.com/ocaml-ppx/ocamlformat
- issues: https://github.com/ocaml-ppx/ocamlformat/issues
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" & < "2.0" -
base
>= "v0.12.0" -
ocaml
>= "4.08" & < "4.15"
Dev Dependencies (5)
-
odoc
with-doc -
ocp-indent
with-test & < "1.9.0" -
dune
with-test & < "3.0" -
cmdliner
with-test & < "1.2.0" -
alcotest
with-test
Optional Dependencies
None
Used by (89)
- 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
- brisk-reconciler
- CamelCase
-
canary
>= "0.0.4" - diff
-
diskuvbox
< "0.2.0" - dream-inertia
- drom
- drom_lib
- drom_toml
- dump_ocamlformat
- dune_deps_extra
- ephemeral
-
ez_cmdliner
>= "0.2.0" -
ez_config
>= "0.2.0" -
ez_file
>= "0.2.0" & < "0.5.0" -
ez_hash
< "0.5.3" - ez_opam_file
- ez_search
- ez_subst
- fromager
-
guardian
>= "0.4.0" - header-check
- highway
-
js_of_ocaml-webgpu
>= "0.2" - jsoo-react
-
letters
>= "0.2.0" & != "0.3.1" - lunar
- melange-fest
-
melange-fetch
>= "0.2.0" -
melange-json
>= "1.2.0" & < "2.0.0" -
melange-radix-icons
>= "0.1.0" - melange-str
- mlx
- module-graph
- nel
- noCanren
- OCanren
-
ocaml-lsp-server
< "1.9.0" -
ocamlformat-rpc
= "0.21.0" -
ocamlmerlin-mlx
>= "0.11" - ocp-search
-
ocplib_stuff
>= "0.3.0" - oktree
-
opam-bin
>= "0.9.5" -
opam_bin_lib
>= "0.9.5" -
owi
>= "0.2" -
pgn_to_tex
< "0.1.0" - pidgin
- pidgio
- polars
- polars_async
-
ppx_deriving_jsonschema
< "0.0.7" -
prelude
>= "0.4" - primavera
-
psmt2-frontend
>= "0.3.0" - query-json
-
quickjs
>= "0.2.0" & < "0.5.0" -
rea
< "0.2.0" - react-rules-of-hooks-ppx
- red-black-tree
- scope
-
sihl
< "0.1.0" - slugline
-
smtml
>= "0.10.0" & < "0.24.0" - solidity-alcotest
- solidity-common
- solidity-parser
- solidity-test
- solidity-typechecker
-
spectrum
>= "0.7.0" - styled-ppx
- synchronizer
-
tezt
>= "3.1.0" & < "4.1.0" - virtfs
-
yamlx
= "0.4.0" -
yocaml
>= "2.0.0"
Conflicts
None
Build status
Results of building ocamlformat with each compiler on check.ci.ocaml.org, run of against opam-repository 7cdc698. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
This version is not in the latest run; the versions below are.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| 0.29.0 | n/a | good | good | good | good |
| 0.28.1 | good | good | good | good | good |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure