package dunolint

  1. Overview
  2. Docs
On This Page
  1. Planned evolution
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Dunolint_engine.ContextSource

Auto-discovery and accumulation of contextual information during tree traversal.

This module provides a context that is built up as the linting engine traverses the directory tree, accumulating information that affects how linting is performed.

The context currently holds a list of dunolint configurations. The order follows the principle of a functional stack: data is added at the head as it is discovered when going deeper in the directory structure, and the configs function returns them in rule processing order (shallowest to deepest).

Planned evolution

The context is designed to support future enhancements:

  1. Config autoloading: Automatically discover and load dunolint config files from the workspace root and subdirectories during traversal, with location tracking to enable path-relative rule evaluation.
  2. Additional dune context: Include information from enclosing dune-project files and dune describe output to provide richer context for linting rules (e.g., project metadata, library dependencies).
Sourcetype t
Sourceval empty : t

An empty context.

Sourcemodule Config_with_location : sig ... end

Configuration with its location in the directory tree.

Sourceval add_config : t -> config:Dunolint.Config.t -> location:Fpath_base.Relative_path.t -> t

Add a discovered config at the specified location.

Get the list of discovered configs with their locations. Returns configs in rule processing order: from least specific (root) to most specific (closest to current location), so that deeper configs can override rules from shallower configs.