package ocamlformat-rpc-lib

  1. Overview
  2. Docs
Auto-formatter for OCaml code (RPC mode)

Install

Dune 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. This package defines a RPC interface to OCamlFormat

Published: 18 Jul 2022

README

README.md

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

  1. csexp >= "1.4.0"
  2. ocaml >= "4.08"
  3. dune >= "2.8"

Dev Dependencies (1)

  1. odoc with-doc

Used by (3)

  1. ocaml-lsp-server >= "1.10.5"
  2. ocamlformat = "0.24.1"
  3. ocamlformat-rpc < "0.19.0"

Conflicts

None