package ortac-wrapper

  1. Overview
  2. Docs
Wrapper plugin for Ortac

Install

Dune Dependency

Authors

Maintainers

Sources

0.7.1.tar.gz
md5=de704f2acde11eb11a3a8f7155d1803c
sha512=060969ff333cd36d445a36ccbab4acf5269a4fae5720389e551fb90c303c09a25db23074b7b243634a507ded1e95a927f4a9af209b21924feda41a57140625b7

doc/src/ortac-wrapper.plugin/ortac_wrapper.ml.html

Source file ortac_wrapper.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
open Cmdliner
open Registration

(* reexpose Generate module as it is used by the monolith plugin for example *)
module Generate = Generate

module Plugin : sig
  val cmd : unit Cmd.t
end = struct
  let main input output () =
    let fmt = get_out_formatter output in
    try Generate.generate input fmt
    with Gospel.Warnings.Error e ->
      Fmt.epr "%a@." Gospel.Warnings.pp e;
      exit 1

  let info =
    Cmd.info "wrapper"
      ~doc:
        "Wrap module functions with assertions to check their specifications."

  let term = Term.(const main $ ocaml_file $ output_file $ setup_log)
  let cmd = Cmd.v info term
end

let () = register Plugin.cmd
OCaml

Innovation. Community. Security.