-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Exit with code 2 on blocking errors #4443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
@@ -78,6 +79,7 @@ def test_python_cmdline(testcase: DataDrivenTestCase) -> None: | |||
path)) | |||
else: | |||
out = normalize_error_messages(out) | |||
out.append('== Return code: {}'.format(result)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.