package dunolint

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

Install

Dune Dependency

Authors

Maintainers

Sources

dunolint-0.0.20250310.tbz
sha256=b44119c96aeabb960e852711c2f20ae43f0011e796f05e012141ba980a5b58f6
sha512=5bf76732adc940db6cac0875e94c3eaff436288faba95388b9675c68b3f30f5362e01f289fc8a096325f7db812ace273773a1e051ab7d7ace3b8db4a57a0e070

doc/dunolint.dunolint_engine/Dunolint_engine/index.html

Module Dunolint_engineSource

Sourcemodule Config : sig ... end
Sourcetype t

Execution control

Sourcemodule Visitor_decision : sig ... end

While we visit the repository, we may decide what to do at each step of the iteration.

parent_dir contains the complete relative path to the cwd from which the command originated, which should be assumed is the root of the repository.

subdirectories and files are the base names of the contents of the parent directory currently being visited.

If you want to visit only a subtree of the repository, you may provide below, which must be a relative path to a subdirectory of the cwd provided for creating t.

Lint

Sourceval lint_file : ?autoformat_file:(new_contents:Base.string -> Base.string) -> ?create_file:(Base.unit -> Base.string) -> ?rewrite_file:(previous_contents:Base.string -> Base.string) -> t -> path:Fpath_base.Relative_path.t -> Base.unit
Sourceval format_dune_file : t -> new_contents:Base.string -> Base.string

Spawn a dune format-dune-file on the new linted contents before materializing into a file. Exposed if you need to write your own linters on files that are supported by the formatter shipped with dune.

Sourceval run : config:Config.t -> (t -> 'a) -> 'a

This calls f once, registers all requests enqueued during the execution of f, and then depending on the config, either do a dry-run, or actually perform the desired transformations.

The intended use is for f to contain one or several calls to a function that uses t to perform some dunolint linting, such as visit, lint_dune_file, etc.

The process_mgr argument is used in order to spawn dune format-dune-file processes to reformat dune files after they have been linted.

In addition to enqueuing debug messages and errors, this function outputs messages regarding I/O actions executed during linting. These messages are produced onto stdout.

Step by step API

Sourceval create : config:Config.t -> t
Sourceval materialize : t -> Base.unit

Apply all the changes that have been saved into t to the file system, or merely print them if we're in dry-run mode.

OCaml

Innovation. Community. Security.