package ocamlformat

Build not checked
  1. Overview
  2. Docs
Auto-formatter for OCaml code

Install

dune-project
 Dependency

Authors

Maintainers

Sources

ocamlformat-0.24.1.tbz
sha256=023425e9818f80ea50537b2371a4a766c149a9957d05807e88a004d2d5f441ce
sha512=753b6128be68042895202f99959b360ce954db6f82b19b83b4bb346761a8e9cfdfc2b4b25e2070e60601b555562e78f9ebb02760ff127464e0b66cedbddca304

Description

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

Added to opam-repository:

README

Build Status

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.

Read the documentation to learn more about OCamlFormat!

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.24.1

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

  1. csexp >= "1.4.0"
  2. uutf >= "1.0.1"
  3. uuseg >= "10.0.0"
  4. stdio
  5. re >= "1.7.2"
  6. odoc-parser >= "2.0.0" & < "2.3.0"
  7. ocp-indent
  8. ocaml-version >= "3.3.0" & < "3.6.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. cmdliner >= "1.1.0" & < "2.0"
  18. base >= "v0.12.0" & < "v0.17.0"
  19. ocaml >= "4.08" & < "5.2"

Dev Dependencies (5)

  1. odoc with-doc
  2. ocp-indent with-test & < "1.9.0"
  3. ocamlformat-rpc-lib with-test & = version
  4. dune < "3.22" & with-test
  5. alcotest with-test

Optional Dependencies

None

Used by (93)

  1. ambient-context < "0.2"
  2. ask
  3. ask-integrator
  4. autofonce
  5. autofonce_config
  6. autofonce_core
  7. autofonce_lib
  8. autofonce_m4
  9. autofonce_misc
  10. autofonce_patch
  11. autofonce_share
  12. awsm-codegen
  13. bastet < "2.0.0"
  14. bitpack_serializer
  15. brisk-reconciler
  16. CamelCase
  17. canary >= "0.0.4"
  18. data-encoding >= "1.0.0"
  19. diff
  20. diskuvbox < "0.2.0"
  21. dream-inertia
  22. drom
  23. drom_lib
  24. drom_toml
  25. dump_ocamlformat
  26. dune_deps_extra
  27. ephemeral
  28. ez_cmdliner >= "0.2.0"
  29. ez_config >= "0.2.0"
  30. ez_file >= "0.2.0" & < "0.5.0"
  31. ez_hash < "0.5.3"
  32. ez_opam_file
  33. ez_search
  34. ez_subst
  35. fromager
  36. guardian != "0.1.0"
  37. header-check
  38. highway
  39. js_of_ocaml-webgpu >= "0.2"
  40. json-data-encoding >= "1.0.0" & < "1.1.1"
  41. jsonschema2atd
  42. letters >= "0.2.0" & != "0.3.1"
  43. lunar
  44. mehari >= "0.5"
  45. melange-fest
  46. melange-fetch >= "0.2.0"
  47. melange-json >= "1.2.0" & < "2.0.0"
  48. melange-radix-icons >= "0.1.0"
  49. melange-str
  50. merge-fmt = "0.3"
  51. mlx
  52. module-graph
  53. nel
  54. noCanren
  55. ocaml-lsp-server < "1.9.0" | = "1.17.0"
  56. ocamlmerlin-mlx >= "0.11"
  57. ocp-search
  58. ocplib_stuff >= "0.3.0"
  59. oktree
  60. opam-bin >= "0.9.5"
  61. opam_bin_lib >= "0.9.5"
  62. opentelemetry >= "0.6" & < "0.12"
  63. owi >= "0.2"
  64. pgn_to_tex < "0.1.0"
  65. pidgin
  66. pidgio
  67. polars
  68. polars_async
  69. ppx_deriving_jsonschema < "0.0.7"
  70. prelude >= "0.4"
  71. primavera
  72. psmt2-frontend >= "0.3.0"
  73. query-json
  74. quickjs >= "0.2.0" & < "0.5.0"
  75. rea < "0.2.0"
  76. react-rules-of-hooks-ppx
  77. red-black-tree
  78. scope
  79. sihl < "0.1.0"
  80. slugline
  81. smtml >= "0.10.0" & < "0.24.0"
  82. solidity-alcotest
  83. solidity-common
  84. solidity-parser
  85. solidity-test
  86. solidity-typechecker
  87. spectrum >= "0.7.0"
  88. styled-ppx
  89. synchronizer
  90. virtfs
  91. yamlx = "0.4.0"
  92. yocaml >= "2.0.0"
  93. zanuda < "1.1.0"

Conflicts

None

Build status

Results of building ocamlformat with each compiler on check.ci.ocaml.org, run of against opam-repository 8d8d144. 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