package dunolint
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=d92e0d705b661ea12b22dcc9bdd83815c507218c1de085d75140fd47bea0c5ec
sha512=fdf4fbb4906aba4aeab766dfa5202b64950c71c988b1b84363319dd05edb93b34142355f968a5687057977e40defdced20a2a17ee0614565096eb123655621f3
doc/dunolint.dune_linter/Dune_linter/Instrumentation/index.html
Module Dune_linter.InstrumentationSource
The "instrumentation" field indicates the instrumentation to be used. It is used in stanza such as library, executable, etc.
val initialize :
condition:
Dunolint_base.Dunolint.Std.Dune.Instrumentation.Predicate.t
Dunolint_base.Dunolint.Std.Blang.t ->
tWhen the field appears in the condition blang, we create a first value to initialize when the field is not originally present.
include Dunolinter.Stanza_linter.S
with type t := t
and type predicate :=
Dunolint_base.Dunolint.Std.Dune.Instrumentation.Predicate.t
If the stanza already exists, parse the value currently present. The sexps_rewriter is given in order to find locations of the supplied sexp to supply to the error messages. Errors are raised if the arguments do not have the expected shape for that field.
Write as a new field. This is used to create the field the first time it is introduced in a stanza, such as when a new dune file is created by dunolint.
val rewrite :
t ->
sexps_rewriter:Sexps_rewriter.t ->
field:Dunolint_stdlib.Sexp.t ->
Base.unitWhen the field is already present, it may be necessary to merge the existing values with the expected one. In this case we do not write the field from scratch, instead we refactor it using a rewrite. The field sexp is expected to be taken from the sexps_rewriter and must be the original sexp that represent the entire field.
If the stanza already exists, all we do is some linting, that is we update it if needed, and perhaps generating some errors or warnings along the way. To be called with the sexps that follow the "(library)" atom, which are labeled "fields".
This has the effect of side-effecting the File_rewriter that is contained by the sexps_rewriter parameter. For this call to be useful, it is assumed that the caller is going to output the resulting rewrite, and do something with it. The field sexp is expected to be taken from the sexps_rewriter and must be the original sexp that represent the entire field.
Getters
Setters
val set_backend :
t ->
backend:Dunolint_base.Dunolint.Std.Dune.Instrumentation.Backend.t ->
Base.unit