Skip to content

Commit

Permalink
Enhance make check (Inspired-by: Stavros Aronis)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuncer Ayaz committed Jan 1, 2012
1 parent 27e5a0a commit af3eab6
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -6,5 +6,7 @@ rebar
rt.work rt.work
.hgignore .hgignore
.eunit .eunit
dialyzer_warnings
xref_warnings
rebar.cmd rebar.cmd
rebar.ps1 rebar.ps1
22 changes: 17 additions & 5 deletions Makefile
@@ -1,13 +1,25 @@
.PHONY: dialyzer_warnings xref_warnings

all: all:
./bootstrap ./bootstrap


clean: clean:
@rm -rf rebar ebin/*.beam inttest/rt.work @rm -rf rebar ebin/*.beam inttest/rt.work


debug: debug:
./bootstrap debug @./bootstrap debug

check: debug xref dialyzer

xref: xref_warnings
@diff -U0 xref_reference xref_warnings

xref_warnings:
-@./rebar xref > xref_warnings

dialyzer: dialyzer_warnings
@diff -U0 dialyzer_reference dialyzer_warnings


check: debug dialyzer_warnings:
-@./rebar xref -@dialyzer -q -n ebin -Wunmatched_returns -Werror_handling \
-@dialyzer ebin --verbose -Wunmatched_returns -Werror_handling \ -Wrace_conditions > dialyzer_warnings
-Wrace_conditions
40 changes: 29 additions & 11 deletions README.md
Expand Up @@ -14,8 +14,9 @@ locations (git, hg, etc).
Building Building
-------- --------


Information on building and installing Erlang/OTP can be found Information on building and installing [Erlang/OTP](http://www.erlang.org)
in the `INSTALL.md` document. can be found [here](https://github.com/erlang/otp/wiki/Installation)
([more info](https://github.com/erlang/otp/blob/master/INSTALL.md)).


### Dependencies ### Dependencies


Expand All @@ -28,7 +29,9 @@ Should you want to clone the rebar repository, you will also require git.


Clone the git repository: Clone the git repository:


$ git clone git://github.com/basho/rebar.git ```sh
$ git clone git://github.com/basho/rebar.git
```


#### Building rebar #### Building rebar


Expand Down Expand Up @@ -69,7 +72,8 @@ Do not mix spaces and tabs.
Do not introduce lines longer than 80 characters. Do not introduce lines longer than 80 characters.


[erlang-mode (emacs)](http://www.erlang.org/doc/man/erlang.el.html) indentation is preferred. [erlang-mode (emacs)](http://www.erlang.org/doc/man/erlang.el.html) indentation is preferred.
vi-only users are encouraged to give [Vim emulation](http://emacswiki.org/emacs/Evil) ([more info](https://gitorious.org/evil/pages/Home)) a try. vi-only users are encouraged to give [Vim emulation](http://emacswiki.org/emacs/Evil)
([more info](https://gitorious.org/evil/pages/Home)) a try.


Writing Commit Messages Writing Commit Messages
----------------------- -----------------------
Expand Down Expand Up @@ -106,18 +110,32 @@ Longer description (wrap at 72 characters)
Dialyzer and Tidier Dialyzer and Tidier
------------------- -------------------


Before you submit a patch check for discrepancies with Before you submit a patch check for
[Dialyzer](http://www.erlang.org/doc/man/dialyzer.html): [xref](http://www.erlang.org/doc/man/xref.html) and
[Dialyzer](http://www.erlang.org/doc/man/dialyzer.html)
warnings.

A successful run of ``make check`` looks like:


```sh ```sh
$ make check $ make check
Recompile: src/rebar_core
==> rebar (compile)
Command 'debug' not understood or not applicable
Congratulations! You now have a self-contained script called "rebar" in
your current working directory. Place this script anywhere in your path
and you can use rebar to build OTP-compliant apps.
make: [xref_warnings] Error 1 (ignored)
make: [dialyzer_warnings] Error 2 (ignored)
``` ```


The following discrepancies are known and safe to ignore: [xref](http://www.erlang.org/doc/man/xref.html) and

[Dialyzer](http://www.erlang.org/doc/man/dialyzer.html) warnings are compared
``` against a set of safe-to-ignore warnings
rebar_utils.erl:147: Call to missing or unexported function escript:foldl/3 found in
``` [dialyzer_reference](https://raw.github.com/tuncer/rebar/maint/dialyzer_reference)
and
[xref_reference](https://raw.github.com/tuncer/rebar/maint/xref_reference).


It is **strongly recommended** to check the code with It is **strongly recommended** to check the code with
[Tidier](http://tidier.softlab.ntua.gr:20000/tidier/getstarted). [Tidier](http://tidier.softlab.ntua.gr:20000/tidier/getstarted).
Expand Down
2 changes: 2 additions & 0 deletions dialyzer_reference
@@ -0,0 +1,2 @@

rebar_utils.erl:163: Call to missing or unexported function escript:foldl/3
2 changes: 2 additions & 0 deletions xref_reference
@@ -0,0 +1,2 @@
==> rebar (xref)
src/rebar_utils.erl:157: Warning escript_foldl/3 calls undefined function escript:foldl/3

0 comments on commit af3eab6

Please sign in to comment.