Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update tools.mk to 0.5.3 and add dialyzer ignore file

  • Loading branch information...
commit 1c66bece57c83342796a5bf94eb67bfaa114cacc 1 parent 3c00369
@Vagabond Vagabond authored
Showing with 62 additions and 24 deletions.
  1. +17 −0 dialyzer.ignore-warnings
  2. +45 −24 tools.mk
View
17 dialyzer.ignore-warnings
@@ -0,0 +1,17 @@
+riak_core.erl:85: The pattern 'true' can never match the type 'false'
+riak_core.erl:185: The pattern 'true' can never match the type 'false'
+riak_core.erl:203: The pattern <'true', _> can never match the type <'false',_>
+riak_core.erl:239: The pattern 'true' can never match the type 'false'
+riak_core.erl:262: Function legacy_remove/1 will never be called
+riak_core_claimant.erl:366: The pattern 'legacy' can never match the type {'error','invalid_resize_claim'} | {'ok',[{_,_},...]}
+riak_core_claimant.erl:403: The pattern {'legacy', _} can never match the type {'error','invalid_resize_claim'} | {'ok',{'chstate_v2',_,'undefined' | [any()],{_,_},'undefined' | dict(),'undefined' | {_,_},'undefined' | [any()],[any()],_,'undefined' | [any()],'undefined' | [any()]}}
+riak_core_claimant.erl:797: The pattern {'legacy', _} can never match the type {'error','invalid_resize_claim'} | {'ok',{'chstate_v2',_,'undefined' | [any()],{_,_},'undefined' | dict(),'undefined' | {_,_},'undefined' | [any()],[any()],_,'undefined' | [any()],'undefined' | [any()]}}
+riak_core_claimant.erl:825: The pattern {'true', 'true'} can never match the type {'true','false'}
+riak_core_console.erl:102: The pattern 'true' can never match the type 'false'
+riak_core_gossip.erl:214: The pattern 1 can never match the type 2
+riak_core_gossip.erl:229: The pattern 'true' can never match the type 'false'
+riak_core_gossip.erl:245: The pattern 'true' can never match the type 'false'
+riak_core_ring_handler.erl:73: The pattern {'true', _, _, _} can never match the type {'false',boolean(),[integer()],'down' | 'exiting' | 'invalid' | 'joining' | 'leaving' | 'valid'}
+Unknown functions:
+ cluster_info:format/3
+ cluster_info:register_app/1
View
69 tools.mk
@@ -1,47 +1,68 @@
+REBAR ?= ./rebar
+
+compile-no-deps:
+ ${REBAR} compile skip_deps=true
+
test: compile
- ./rebar eunit skip_deps=true
+ ${REBAR} eunit skip_deps=true
docs:
- ./rebar doc skip_deps=true
+ ${REBAR} doc skip_deps=true
xref: compile
- ./rebar xref skip_deps=true
+ ${REBAR} xref skip_deps=true
-PLT ?= $(HOME)/.riak_combo_dialyzer_plt
+PLT ?= $(HOME)/.combo_dialyzer_plt
LOCAL_PLT = .local_dialyzer_plt
DIALYZER_FLAGS ?= -Wunmatched_returns
${PLT}: compile
-ifneq (,$(wildcard $(PLT)))
- dialyzer --check_plt --plt $(PLT) --apps $(DIALYZER_APPS) && \
- dialyzer --add_to_plt --plt $(PLT) --output_plt $(PLT) --apps $(DIALYZER_APPS) ; test $$? -ne 1
-else
- dialyzer --build_plt --output_plt $(PLT) --apps $(DIALYZER_APPS); test $$? -ne 1
-endif
+ @if [ -f $(PLT) ]; then \
+ dialyzer --check_plt --plt $(PLT) --apps $(DIALYZER_APPS) && \
+ dialyzer --add_to_plt --plt $(PLT) --output_plt $(PLT) --apps $(DIALYZER_APPS) ; test $$? -ne 1; \
+ else \
+ dialyzer --build_plt --output_plt $(PLT) --apps $(DIALYZER_APPS); test $$? -ne 1; \
+ fi
${LOCAL_PLT}: compile
-ifneq (,$(wildcard deps/*))
-ifneq (,$(wildcard $(LOCAL_PLT)))
- dialyzer --check_plt --plt $(LOCAL_PLT) deps/*/ebin && \
- dialyzer --add_to_plt --plt $(LOCAL_PLT) --output_plt $(LOCAL_PLT) deps/*/ebin ; test $$? -ne 1
-else
- dialyzer --build_plt --output_plt $(LOCAL_PLT) deps/*/ebin ; test $$? -ne 1
-endif
-endif
-
-dialyzer: ${PLT} ${LOCAL_PLT}
+ @if [ -d deps ]; then \
+ if [ -f $(LOCAL_PLT) ]; then \
+ dialyzer --check_plt --plt $(LOCAL_PLT) deps/*/ebin && \
+ dialyzer --add_to_plt --plt $(LOCAL_PLT) --output_plt $(LOCAL_PLT) deps/*/ebin ; test $$? -ne 1; \
+ else \
+ dialyzer --build_plt --output_plt $(LOCAL_PLT) deps/*/ebin ; test $$? -ne 1; \
+ fi \
+ fi
+
+dialyzer-run:
@echo "==> $(shell basename $(shell pwd)) (dialyzer)"
@if [ -f $(LOCAL_PLT) ]; then \
- dialyzer $(DIALYZER_FLAGS) --plts $(PLT) $(LOCAL_PLT) -c ebin; \
+ PLTS="$(PLT) $(LOCAL_PLT)"; \
+ else \
+ PLTS=$(PLT); \
+ fi; \
+ if [ -f dialyzer.ignore-warnings ]; then \
+ if [ $$(grep -cvE '[^[:space:]]' dialyzer.ignore-warnings) -ne 0 ]; then \
+ echo "ERROR: dialyzer.ignore-warnings contains a blank/empty line, this will match all messages!"; \
+ exit 1; \
+ fi; \
+ dialyzer $(DIALYZER_FLAGS) --plts $${PLTS} -c ebin > dialyzer_warnings ; \
+ egrep -v "^\s*(done|Checking|Proceeding|Compiling)" dialyzer_warnings | grep -F -f dialyzer.ignore-warnings -v > dialyzer_unhandled_warnings ; \
+ cat dialyzer_unhandled_warnings ; \
+ [ $$(cat dialyzer_unhandled_warnings | wc -l) -eq 0 ] ; \
else \
- dialyzer $(DIALYZER_FLAGS) --plts $(PLT) -c ebin; \
+ dialyzer $(DIALYZER_FLAGS) --plts $${PLTS} -c ebin; \
fi
+dialyzer-quick: compile-no-deps dialyzer-run
+
+dialyzer: ${PLT} ${LOCAL_PLT} dialyzer-run
+
cleanplt:
- @echo
+ @echo
@echo "Are you sure? It takes several minutes to re-build."
@echo Deleting $(PLT) and $(LOCAL_PLT) in 5 seconds.
- @echo
+ @echo
sleep 5
rm $(PLT)
rm $(LOCAL_PLT)
Please sign in to comment.
Something went wrong with that request. Please try again.