Skip to content

Commit 1731456

Browse files
committed
Use rebar3 dialyzer.
1 parent 04bf4d3 commit 1731456

File tree

2 files changed

+4
-53
lines changed

2 files changed

+4
-53
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ rel:
2121

2222
stage:
2323
$(REBAR) release -d
24+
25+
dialyzer:
26+
$(REBAR) dialyzer

tools.mk

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,7 @@
1-
REBAR ?= ./rebar
1+
REBAR ?= ./rebar3
22

33
docs:
44
${REBAR} doc skip_deps=true
55

66
xref: compile
77
${REBAR} xref skip_deps=true
8-
9-
PLT ?= $(HOME)/.combo_dialyzer_plt
10-
LOCAL_PLT = .local_dialyzer_plt
11-
DIALYZER_FLAGS ?= -Wunmatched_returns -Werror_handling -Wrace_conditions -Wunderspecs
12-
13-
${PLT}: compile
14-
@if [ -f $(PLT) ]; then \
15-
dialyzer --check_plt --plt $(PLT) --apps $(DIALYZER_APPS) && \
16-
dialyzer --add_to_plt --plt $(PLT) --output_plt $(PLT) --apps $(DIALYZER_APPS) ; test $$? -ne 1; \
17-
else \
18-
dialyzer --build_plt --output_plt $(PLT) --apps $(DIALYZER_APPS); test $$? -ne 1; \
19-
fi
20-
21-
${LOCAL_PLT}: compile
22-
@if [ -d deps ]; then \
23-
if [ -f $(LOCAL_PLT) ]; then \
24-
dialyzer --check_plt --plt $(LOCAL_PLT) deps/*/ebin && \
25-
dialyzer --add_to_plt --plt $(LOCAL_PLT) --output_plt $(LOCAL_PLT) deps/*/ebin ; test $$? -ne 1; \
26-
else \
27-
dialyzer --build_plt --output_plt $(LOCAL_PLT) deps/*/ebin ; test $$? -ne 1; \
28-
fi \
29-
fi
30-
31-
dialyzer: ${PLT} ${LOCAL_PLT}
32-
@echo "==> $(shell basename $(shell pwd)) (dialyzer)"
33-
@if [ -f $(LOCAL_PLT) ]; then \
34-
PLTS="$(PLT) $(LOCAL_PLT)"; \
35-
else \
36-
PLTS=$(PLT); \
37-
fi; \
38-
if [ -f dialyzer.ignore-warnings ]; then \
39-
if [ $$(grep -cvE '[^[:space:]]' dialyzer.ignore-warnings) -ne 0 ]; then \
40-
echo "ERROR: dialyzer.ignore-warnings contains a blank/empty line, this will match all messages!"; \
41-
exit 1; \
42-
fi; \
43-
dialyzer $(DIALYZER_FLAGS) --plts $${PLTS} -c ebin > dialyzer_warnings ; \
44-
egrep -v "^[[:space:]]*(done|Checking|Proceeding|Compiling)" dialyzer_warnings | grep -F -f dialyzer.ignore-warnings -v > dialyzer_unhandled_warnings ; \
45-
cat dialyzer_unhandled_warnings ; \
46-
[ $$(cat dialyzer_unhandled_warnings | wc -l) -eq 0 ] ; \
47-
else \
48-
dialyzer $(DIALYZER_FLAGS) --plts $${PLTS} -c ebin; \
49-
fi
50-
51-
cleanplt:
52-
@echo
53-
@echo "Are you sure? It takes several minutes to re-build."
54-
@echo Deleting $(PLT) and $(LOCAL_PLT) in 5 seconds.
55-
@echo
56-
sleep 5
57-
rm $(PLT)
58-
rm $(LOCAL_PLT)
59-

0 commit comments

Comments
 (0)