Open metametadata opened 7 years ago
Perhaps generalizing a bit, it should arguably be possible for users to bind their own warning handler function. Currently, the code is structured to set the warning handler that causes the error indicator to be used. https://github.com/anmonteiro/lumo/blob/09c9d125392a687e3dab7a394485caf73cee6752/src/cljs/snapshot/lumo/repl.cljs#L1061
(I'm wondering if a strategy of first checking to see if the default warning handlers set up by ClojureScript are still in place, and assuming if not, that user-level code has replaced them and that they shoudn't be further modified, would work out. I haven't wrapped my mind around whether this is possible to do, though, given that these are analyzer warnings. Hmm.)
Lumo should support treating warnings as errors. E.g. after passing an additional flag to the executable.
Motivation: to have more reliable scripts. Currently it's too easy to miss an unexpected behaviour on script execution.
Example:
Actual: Expression
456
is reached. Exit code is0
.Expected: Lumo exits on warning,
456
is not reached. Exit code is1
.I tried to manually catch
cljs.analyzer
warnings inside my scripts but with no luck.