Add `--quit-on-syntax-error` option?
For our CI tests, it would be helpful if we could reliably and globally detect syntax errors – these often are not detected by tests, yet can contain crucial hints about issues.
To this end, having an option which turns every kernel call to SyntaxError (and possibly also SyntaxWarning) into a hard error with non-zero exit code would be useful.
Max Horn writes:
For our CI tests, it would be helpful if we could reliably and globally detect syntax errors -- these often are not detected by tests, yet can contain crucial hints about issues.
To this end, having an options which turns every kernel call to
SyntaxError(and possibly alsoSyntaxWarning) into a hard error with non-zero exit code would be useful.
I would like to be able to catch SyntaxError and SyntaxWarning for Jupyter (which will probably necessitate some "callback" mechanism?
Seperate from @markuspf wanting a callback, we could extend/rename --quit-on-break to also cover syntax errors.
There is --quitonbreak which does this, but no --quitonwarning. The latter would also be useful, e.g. for #2782.