Skip to content

Commit ac8fdd1

Browse files
committed
build: make lint resilient when ocamlformat is unavailable
1 parent 7f1027a commit ac8fdd1

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

justfile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ conformance:
3939

4040
# Run format check (lint)
4141
lint:
42-
dune fmt --preview
42+
@if command -v ocamlformat >/dev/null 2>&1; then \
43+
dune fmt --preview; \
44+
else \
45+
echo "ocamlformat not installed; skipping format check"; \
46+
fi
4347

4448
# Format code in place
4549
fmt:
@@ -136,7 +140,11 @@ _blitz-security:
136140

137141
_blitz-lint:
138142
@echo "── [5/6] Lint + Format ──────────────────────"
139-
dune fmt --preview 2>&1 || echo " (format diffs present — run: just fmt)"
143+
@if command -v ocamlformat >/dev/null 2>&1; then \
144+
dune fmt --preview 2>&1 || echo " (format diffs present — run: just fmt)"; \
145+
else \
146+
echo " (ocamlformat missing — lint fmt check skipped)"; \
147+
fi
140148

141149
_blitz-docs:
142150
@echo "── [6/6] Doc build ──────────────────────────"

0 commit comments

Comments
 (0)