OCaml: Add development watch commands to justfile

This commit is contained in:
Juno Takano 2025-04-16 22:07:38 -03:00
commit dc85dc0493

View file

@ -1,20 +1,32 @@
_default: _default:
@just --list @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 # Build project with Dune
[group('build')] [group('build')]
build: build:
dune build dune build
alias b := build
# Cleanup build artifacts # Cleanup build artifacts
[group('build')] [group('build')]
clean: clean:
dune clean dune clean
alias c := clean
# Generate coverage files and report # Generate coverage files and report
[group('checks')] [group('checks')]
cover : clean build cover : clean build
@ -27,36 +39,26 @@ cover : clean build
[group('checks')] [group('checks')]
full-build: clean check cover full-build: clean check cover
alias fb := full-build
# Check formatting and run tests with coverage # Check formatting and run tests with coverage
[group('checks')] [group('checks')]
check: format-check cover check: format-check cover
alias ck := check
# Run tests # Run tests
[group('checks')] [group('checks')]
test : build test : build
dune test dune test
alias t := test
# Format all files # Format all files
[group('checks')] [group('checks')]
format: format:
dune fmt dune fmt
dune promote dune promote
alias fmt := format
# Check formatting without changing files # Check formatting without changing files
[group('checks')] [group('checks')]
format-check: format-check:
dune fmt --preview dune fmt --preview
alias f := format-check
# Show system, compiler and tooling information # Show system, compiler and tooling information
info: info:
@echo OCaml version: $(ocamlc --version) @echo OCaml version: $(ocamlc --version)