Exit with code 2 on blocking errors#4443
Conversation
Exit with code 2 on blocking errors, while continuing to exit with 1 when there are nonblocking errors. Add test infrastructure. Fixes #2754.
|
(This depends on #4396 because they would otherwise conflict) |
gvanrossum
left a comment
There was a problem hiding this comment.
I also would like to see the exit code 2 if a file can't be read or decoded. There are two errors for this in build.py (L1829 ff) but they don't seem to be using the "blocker" mechanism.
mypy/test/testcmdline.py
Outdated
| path)) | ||
| else: | ||
| out = normalize_error_messages(out) | ||
| out.append('== Return code: {}'.format(result)) |
There was a problem hiding this comment.
Hm, this added a lot of noise to a lot of tests. Perhaps only print the return code when it's not equal to not len(out)?
|
Those cases don't add blockers to the errors object, but they raise CompileError directly, which causes us to exit with 2. One of the tests I added checks for this. |
|
Ah, I see. But I'd still like to see fewer tests with different output. |
gvanrossum
left a comment
There was a problem hiding this comment.
LG! (But it has to wait until the streaming PR lands.)
|
Whee! |
Exit with code 2 on blocking errors, while continuing to exit with 1
when there are nonblocking errors. Add test infrastructure.
Fixes #2754.