OCaml linter enforcing modern coding conventions
README.md

Scripts #

This directory holds two build-time programs. generate_examples_ml.ml generates the rule examples from the cram test fixtures, and check_test_integrity.ml checks during dune test that each rule's cram test runs merlint on both its good and its bad fixtures.

Git hooks #

The pre-commit hook (formatting and merlint) and the commit-msg hook are installed by the precommit tool:

$ opam install precommit
$ precommit init

The pre-commit hook runs dune fmt, which fixes formatting across the whole tree, then merlint --build .. It works with both git commit and git-x commit. The commit-msg hook is precommit's ai hook: it rejects a message containing emojis and removes lines that attribute the commit to an AI assistant. --hooks fmt,ai installs the formatting and commit-msg hooks without the merlint check, and git commit --no-verify (or git-x commit create --no-verify) skips them in an emergency.