You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by rn...@apache.org on 2023/01/04 22:02:45 UTC

[couchdb] 01/01: add find_bugs makefile target for undefined functions

This is an automated email from the ASF dual-hosted git repository.

rnewson pushed a commit to branch find_bugs
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit d524ddb4ffe3585a86aa8b657f30e0e22d07b307
Author: Robert Newson <rn...@apache.org>
AuthorDate: Wed Jan 4 22:02:20 2023 +0000

    add find_bugs makefile target for undefined functions
---
 Makefile            | 5 +++++
 rebar.config.script | 1 +
 2 files changed, 6 insertions(+)

diff --git a/Makefile b/Makefile
index 4359a6dd3..00036cc68 100644
--- a/Makefile
+++ b/Makefile
@@ -350,6 +350,11 @@ dialyze: .rebar
 	@$(REBAR) -r dialyze $(DIALYZE_OPTS)
 
 
+.PHONY: find_bugs
+# target: xref - find unused exports etc
+find_bugs:
+	@$(REBAR) --keep-going --recursive xref $(DIALYZE_OPTS)
+
 .PHONY: introspect
 # target: introspect - Check for commits difference between rebar.config and repository
 introspect:
diff --git a/rebar.config.script b/rebar.config.script
index 1ae61129f..c6aced66b 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -194,6 +194,7 @@ AddConfig = [
     {lib_dirs, ["src"]},
     {erl_opts, [{i, "../"}, {d, 'COUCHDB_ERLANG_VERSION', VerString}]},
     {eunit_opts, [verbose, {report,{eunit_surefire,[{dir,"."}]}}]},
+    {xref_checks, [undefined_function_calls, undefined_functions]},
     {plugins, [eunit_plugin]},
     {dialyzer, [
         {plt_location, local},