Merge: Robust keep-going
authorJean Privat <jean@pryen.org>
Wed, 8 Apr 2015 01:00:53 +0000 (08:00 +0700)
committerJean Privat <jean@pryen.org>
Wed, 8 Apr 2015 01:00:53 +0000 (08:00 +0700)
Detection and resolution of crashes or irrelevant error messages with tools that keeps going (eg. nitpick).

Historically, the compiler just exited at the end on a step when an error occured. The ToolContext#keep_going flag disable this automatic exit and was introduced for tool that are expected to be launched on broken code: nitpick and nitlight. However most parts of the code expected that:

* the previous steps where completed successfully, and expected information where available and correct.
* they are that special important snowflake can just exit the whole program when they are unhappy.

These rules can make sense for a compiler but are to strict for most SE tools that need to work (or continue working) when some random module contain an error.
Thus this PR improve the robustness of various parts of the code for the keep-going case so that we do not exit or crash before having processed all the modules.

With this PR, the following command does not crash anymore:

~~~
$ nitpick `nitls -rps ../lib ../contrib ../examples`
[...]
Errors: 10. Warnings: 31.
~~~

Note that `nitpick ../tests` still crashes. There is ugly errors hard to recover from in this directory.

Maybe, one day most of the tools can be made keep going by default.

Pull-Request: #1241
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Etienne M. Gagnon <egagnon@j-meg.com>


Trivial merge