package dunolint

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

Module Executable.NameSource

Sourcetype t
include Dunolinter.Stanza_linter.S with type t := t and type predicate := Dunolint.Std.Dune.Executable.Name.Predicate.t
Sourceval sexp_of_t : t -> Sexplib0.Sexp.t
Sourceval field_name : Base.string
Sourceval read : sexps_rewriter:Sexps_rewriter.t -> field:Base.Sexp.t -> 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.

Sourceval write : t -> Base.Sexp.t

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.

Sourceval rewrite : t -> sexps_rewriter:Sexps_rewriter.t -> field:Base.Sexp.t -> Base.unit

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

Sourceval enforce : t -> condition:Dunolint.Std.Dune.Executable.Name.Predicate.t Dunolint.Std.Blang.t -> Base.unit
OCaml

Innovation. Community. Security.