[ocamlformat] Support passing args to ocamlformat

Summary: Useful for testing / debugging ocamlformat updates

Reviewed By: skcho

Differential Revision: D21395971

fbshipit-source-id: d4f2f2dcb
master
Josh Berdine 5 years ago committed by Facebook GitHub Bot
parent 1ed9f2f9b6
commit bab005a835

@ -218,19 +218,19 @@ fb-setup:
.PHONY: fmt
fmt:
parallel $(OCAMLFORMAT_EXE) -i ::: $$(git diff --name-only --diff-filter=ACMRU $$(git merge-base origin/master HEAD) | grep "\.mli\?$$")
parallel $(OCAMLFORMAT_EXE) $(OCAMLFORMAT_ARGS) -i ::: $$(git diff --name-only --diff-filter=ACMRU $$(git merge-base origin/master HEAD) | grep "\.mli\?$$")
DUNE_ML:=$(shell find * -name 'dune*.in' | grep -v workspace | grep -v infer-source)
.PHONY: fmt_dune
fmt_dune:
parallel $(OCAMLFORMAT_EXE) -i ::: $(DUNE_ML)
parallel $(OCAMLFORMAT_EXE) $(OCAMLFORMAT_ARGS) -i ::: $(DUNE_ML)
SRC_ML:=$(shell find * \( -name _build -or -name facebook-clang-plugins -or -path facebook/dependencies -or -path sledge/llvm -or -path sledge/.llvm_build \) -not -prune -or -type f -and -name '*'.ml -or -name '*'.mli 2>/dev/null)
.PHONY: fmt_all
fmt_all:
parallel $(OCAMLFORMAT_EXE) -i ::: $(SRC_ML) $(DUNE_ML)
parallel $(OCAMLFORMAT_EXE) $(OCAMLFORMAT_ARGS) -i ::: $(SRC_ML) $(DUNE_ML)
# pre-building these avoids race conditions when building, eg src_build and test_build in parallel
.PHONY: src_build_common

Loading…
Cancel
Save