add pre-commit hook for formatting
Some checks are pending
format / format (push) Waiting to run
build / build (4.08.x, ubuntu-latest) (push) Waiting to run
build / build (4.13.x, ubuntu-latest) (push) Waiting to run
build / build (5.0.x, ubuntu-latest) (push) Waiting to run
build / build (5.3.x, ubuntu-latest) (push) Waiting to run

This commit is contained in:
Simon Cruanes 2026-03-12 21:38:51 -04:00
parent ceb3fb75f8
commit 2c52df1fae
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
2 changed files with 13 additions and 0 deletions

10
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,10 @@
repos:
- repo: local
hooks:
- id: ocamlformat
name: ocamlformat check
entry: make format-check
language: system
files: \.(ml|mli)$
pass_filenames: false
stages: [pre-push]

View file

@ -29,6 +29,9 @@ format:
format-check:
@dune build $(DUNE_OPTS) @fmt --display=quiet
setup-githooks:
uvx pre-commit install --hook-type pre-push
WATCH ?= @all
watch:
@dune build $(WATCH) -w $(OPTS)