package zanuda

  1. Overview
  2. Docs
Linter for OCaml+dune projects

Install

dune-project
 Dependency

Authors

Maintainers

Sources

zanuda-2.0.0.tbz
sha256=0108d8d6e6e23bfe5e5cdade27ae434db921ed4b6f522ea71800f14a7662230e
sha512=c8d633f4083867dfc73caf3b51b63c8c01771f5c286aa0a8357861044448e0b55df38eb695b997df470267ec921adae6f86c73d251fb3e965ac83ebb2c6b856c

Description

Lints for OCaml projects. Primary usage is for teaching/education

Tags

lint test

Published: 19 Sep 2025

README

Build Master 4.14 Build Master 5.3 License Lints docs API docs Coverage Status opam package status

A linter for OCaml+dune projects

A linter is a tool that discovers bugs and obscurities in the code. The name was invented in 1978 paper of S. C. Johnson: Lint, a C Program Checker.

This is a list of currently supported analyses.

From techinical point of view, most of the lints study Typedtree, so the input for linter should be a fully compiled dune project. There is a support of linters that study untyped tree, but I don't expect them to be widely used. These two abstract trees don't allow to find all possible code quirks. Currently, we delegate job of detecting something like f(1)(2)(3) to ocamlformat.

This linter is inspired by:

But I'm aware that there are other linters like Camelot for OCaml and Clippy Rust.

Usage

Examples of 'zanuda' usage could be found in the 'tests' directory. But in short:

  • Compile your dune project and run this linter via

        dune build @check @runtest -j3
    zanuda -dir .

    It will report found issues using OCaml's alerts

  • You could read the documentation about supported lints via zanuda -dump. CI runs regularly uploads information about available lints to GitHub Pages.
  • You could run linter and dump the results in short JSON form: zanuda -dir . -ordjsonl /tmp/1.rdjsonl. They could be processed later, for example as review comment via GitHub API. (This reporting is not implemented yet.)
Developping

To get dependecies you could use standard dune/opam machinery:

    opam pin add ./ -n
opam install . --deps-only --with-test --with-doc

Running a single test:

dune b @tests/typed/License

Running all tests:

dune test
See also

Dependencies (10)

  1. ppx_optcomp
  2. ppx_expect_nobase
  3. ppx_assert
  4. dune-build-info
  5. bisect_ppx
  6. sexplib
  7. angstrom >= "0.15.0" & <= "0.16.0"
  8. yojson >= "2.0.0"
  9. ocaml >= "4.14.2" & < "5.0.0" | >= "5.3.0" & < "5.4.0"
  10. dune >= "3.4"

Dev Dependencies (11)

  1. odig with-doc
  2. odoc with-doc
  3. ocamlformat = "0.27.0" & with-dev-setup
  4. menhir with-test
  5. ppx_blob with-test
  6. ppx_deriving with-test
  7. ppx_fields_conv with-test
  8. ppx_expect with-test
  9. ppx_inline_test with-test
  10. ppx_assert with-test
  11. base with-test

Used by

None

Conflicts

None