Browse Source

Allow overriding the method and directories analyzed by Dialyzer

Loïc Hoguin 10 years ago
parent
commit
724f024bbf
3 changed files with 8 additions and 3 deletions
  1. 4 1
      README.md
  2. 2 1
      erlang.mk
  3. 2 1
      plugins/dialyzer.mk

+ 4 - 1
README.md

@@ -301,7 +301,10 @@ included in the PLT file. There is no need to specify `erts`,
 are automatically added.
 
 Dialyzer options can be modified by defining the `DIALYZER_OPTS`
-variable. For more information please see `erl -man dialyzer`.
+variable. The directories to be analyzed can be overriden using
+the `DIALYZER_DIRS` variable. It defaults to analyzing source
+files recursively found in `src/`. For more information please
+see `erl -man dialyzer`.
 
 EDoc plugin
 -----------

+ 2 - 1
erlang.mk

@@ -628,6 +628,7 @@ DIALYZER_PLT ?= $(CURDIR)/.$(PROJECT).plt
 export DIALYZER_PLT
 
 PLT_APPS ?=
+DIALYZER_DIRS ?= --src -r src
 DIALYZER_OPTS ?= -Werror_handling -Wrace_conditions \
 	-Wunmatched_returns # -Wunderspecs
 
@@ -656,7 +657,7 @@ dialyze:
 else
 dialyze: $(DIALYZER_PLT)
 endif
-	@dialyzer --no_native --src -r src $(DIALYZER_OPTS)
+	@dialyzer --no_native $(DIALYZER_DIRS) $(DIALYZER_OPTS)
 
 # Copyright (c) 2013-2014, Loïc Hoguin <essen@ninenines.eu>
 # This file is part of erlang.mk and subject to the terms of the ISC License.

+ 2 - 1
plugins/dialyzer.mk

@@ -9,6 +9,7 @@ DIALYZER_PLT ?= $(CURDIR)/.$(PROJECT).plt
 export DIALYZER_PLT
 
 PLT_APPS ?=
+DIALYZER_DIRS ?= --src -r src
 DIALYZER_OPTS ?= -Werror_handling -Wrace_conditions \
 	-Wunmatched_returns # -Wunderspecs
 
@@ -37,4 +38,4 @@ dialyze:
 else
 dialyze: $(DIALYZER_PLT)
 endif
-	@dialyzer --no_native --src -r src $(DIALYZER_OPTS)
+	@dialyzer --no_native $(DIALYZER_DIRS) $(DIALYZER_OPTS)