package dunolint

  1. Overview
  2. Docs
A linter for build files in dune projects

Install

dune-project
 Dependency

Authors

Maintainers

Sources

dunolint-0.0.20250804.tbz
sha256=e4ca7c98db73dd9ab2ae8cba37ee0645f580267484e9893dbce6e28f4f2f0170
sha512=7ca658fb96139a0c41724355ac6aaf83d75468c7df14569b8f6090711f73a8fb2408ed1145384e756418682f0fa660a915842fd2b3f8b42e5ed4990e795b384e

doc/dunolint.dunolinter/Dunolinter/Sexp_handler/Make_sexpable_list/index.html

Module Sexp_handler.Make_sexpable_listSource

A util to create a handler for multiple args with the same sexpable type. The handler will expect a list of arguments, which will each be parsed and written (or replaced) according to the sexp serializer provided.

Parameters

module _ : sig ... end

Signature

t is type OCaml representation of what the field encodes. It does not need to encapsulate the complete information that code be represented by dune, only that part that dunolint wants to lint.

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.

OCaml

Innovation. Community. Security.