Prepare to format OCaml and convert Reason code

Summary:
Add support for converting without actually converting. To be used as
a landing pad for rebasing over the conversion.

Reviewed By: jvillard

Differential Revision: D5379967

fbshipit-source-id: 1bd932d
master
Josh Berdine 7 years ago committed by Facebook Github Bot
parent 927a6cfbb6
commit bf2a0cfc53

@ -0,0 +1,2 @@
margin 100
sparse true

@ -111,6 +111,30 @@ fb-setup:
$(QUIET)$(call silent_on_success,Facebook setup,\
$(MAKE) -C facebook setup)
OCAMLFORMAT_EXE=facebook/dependencies/ocamlformat/src/_build/opt/ocamlformat.exe
SRC_ML:=$(shell find * \( -name _build -or -name facebook-clang-plugins -or -path facebook/dependencies \) -not -prune -or -type f -and -name '*'.ml -or -name '*'.mli 2>/dev/null)
.PHONY: fmt_all_ml
fmt_all_ml:
parallel $(OCAMLFORMAT_EXE) --no-warn-error -i -- $(SRC_ML)
SRC_RE:=$(shell find infer/src -name '*'.re 2>/dev/null)
SRC_REI:=$(shell find infer/src -name '*'.rei 2>/dev/null)
SRC_RE_ML:=$(patsubst %.re,%.ml,$(SRC_RE))
SRC_REI_MLI:=$(patsubst %.rei,%.mli,$(SRC_REI))
%.ml: %.re
refmt --print=binary_reason $< | $(OCAMLFORMAT_EXE) $< --reason-impl -o $@
%.mli: %.rei
refmt --print=binary_reason $< | $(OCAMLFORMAT_EXE) $< --reason-intf -o $@
.PHONY: fmt_all
fmt_all: fmt_all_ml $(SRC_RE_ML) $(SRC_REI_MLI)
git add $(SRC_RE_ML) $(SRC_REI_MLI)
rm -f $(SRC_RE) $(SRC_REI)
.PHONY: src_build
src_build:
$(QUIET)$(call silent_on_success,Building native Infer,\
@ -308,7 +332,7 @@ toplevel: clang_plugin
inferScriptMode_test: test_build
$(QUIET)$(call silent_on_success,Testing infer OCaml REPL,\
INFER_REPL_BINARY=ocaml TOPLEVEL_DIR=$(BUILD_DIR)/test/infer $(SCRIPT_DIR)/infer_repl \
$(INFER_DIR)/tests/repl/infer_batch_script.ml)
$(INFER_DIR)/tests/repl/infer_batch_script.mltop)
.PHONY: checkCopyright
checkCopyright:

@ -18,7 +18,7 @@ AC_INIT([Infer],
[0.12.0],
[https://github.com/facebook/infer/issues/])
AC_CONFIG_SRCDIR([infer/src/IR/Sil.re])
AC_CONFIG_SRCDIR([infer/src/base/IStd.ml])
# WARNING: keep in sync with above
INFER_MAJOR=0

Loading…
Cancel
Save