From dc85dc0493f00e5020c49d7717d8e6c0d2688b9d Mon Sep 17 00:00:00 2001 From: jutty Date: Wed, 16 Apr 2025 22:07:38 -0300 Subject: [PATCH] OCaml: Add development watch commands to justfile --- ocaml/.justfile | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/ocaml/.justfile b/ocaml/.justfile index ea6561a..aab4731 100644 --- a/ocaml/.justfile +++ b/ocaml/.justfile @@ -1,20 +1,32 @@ _default: @just --list +[group('dev')] +exec *args: + dune exec tori -- {{ args }} + +[group('dev')] +exec-watch *args: + dune exec --watch tori -- {{ args }} + +[group('dev')] +test-watch *args: + dune test --watch + +[group('dev')] +format-watch *args: + find . -regex '.*\.mli?$' | entr -c -- dune fmt --preview + # Build project with Dune [group('build')] build: dune build -alias b := build - # Cleanup build artifacts [group('build')] clean: dune clean -alias c := clean - # Generate coverage files and report [group('checks')] cover : clean build @@ -27,36 +39,26 @@ cover : clean build [group('checks')] full-build: clean check cover -alias fb := full-build - # Check formatting and run tests with coverage [group('checks')] check: format-check cover -alias ck := check - # Run tests [group('checks')] test : build dune test -alias t := test - # Format all files [group('checks')] format: dune fmt dune promote -alias fmt := format - # Check formatting without changing files [group('checks')] format-check: dune fmt --preview -alias f := format-check - # Show system, compiler and tooling information info: @echo OCaml version: $(ocamlc --version)