package ocamlformat-lib

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

This module contains ways to declare command-line and config-files options for ocamlformat. To look at declared options, see Conf.mli. To declare a new option :

  • Add a field to one of the records in Conf_t
  • Declare the option in Conf, using functions from this module.
type typ =
  1. | Int
  2. | Bool
  3. | Range
  4. | Ocaml_version
  5. | Choice of Ocamlformat_stdlib.string Ocamlformat_stdlib.list
module UI : sig ... end
type 'a t

The type of an option declaration

type kind =
  1. | Formatting
  2. | Operational
type deprecated
type removed
type status = [
  1. | `Valid
  2. | `Deprecated of deprecated
  3. | `Removed of removed
]
type 'a declarator = names:Ocamlformat_stdlib.string Ocamlformat_stdlib.list -> default:Conf_t.t -> doc:Ocamlformat_stdlib.string -> kind:kind -> ?allow_inline:Ocamlformat_stdlib.bool -> ?status:[ `Valid | `Deprecated of deprecated ] -> (Conf_t.t -> 'a Conf_t.elt -> Conf_t.t) -> (Conf_t.t -> 'a Conf_t.elt) -> 'a t

The type of option declarators, that is functions returning a declaration

val section_name : kind -> status -> Ocamlformat_stdlib.string
val deprecated : since:Version.t -> Ocamlformat_stdlib.string -> deprecated
val removed : since:Version.t -> Ocamlformat_stdlib.string -> removed
module Value : sig ... end

Values of multiple-choice options

module Value_removed : sig ... end
module Store : sig ... end
val ocaml_version : Ocaml_version.t declarator
val any : 'a Cmdliner.Arg.conv -> values:typ -> docv:Ocamlformat_stdlib.string -> 'a declarator

Declare an option as removed. Using such an option will result in an helpful error including msg and since.

val default : 'a t -> 'a
val update : Store.t -> config:Conf_t.t -> from:Conf_t.updated_from -> name:Ocamlformat_stdlib.string -> value:Ocamlformat_stdlib.string -> inline:Ocamlformat_stdlib.bool -> (Conf_t.t, Conf_t.Error.t) Ocamlformat_stdlib.Result.t
val to_ui : 'a t -> Conf_t.t UI.t
val print_config : Store.t -> Conf_t.t -> Ocamlformat_stdlib.unit
OCaml

Innovation. Community. Security.