8000 Exit with code 2 on blocking errors by msullivan · Pull Request #4443 · python/mypy · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 3 commits into from
Jan 9, 2018
Merged

Exit with code 2 on blocking errors #4443

merged 3 commits into from
Jan 9, 2018

Conversation

msullivan
Copy link
Collaborator

Exit with code 2 on blocking errors, while continuing to exit with 1
when there are nonblocking errors. Add test infrastructure.

Fixes #2754.

Exit with code 2 on blocking errors, while continuing to exit with 1
when there are nonblocking errors.  Add test infrastructure.

Fixes #2754.
@msullivan msullivan requested a review from gvanrossum January 8, 2018 22:54
@msullivan
Copy link
Collaborator Author

(This depends on #4396 because they would otherwise conflict)

Copy link
Member
@gvanrossum gvanrossum left a 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.

@@ -78,6 +79,7 @@ def test_python_cmdline(testcase: DataDrivenTestCase) -> None:
path))
else:
out = normalize_error_messages(out)
out.append('== Return code: {}'.format(result))
Copy link
Member

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)?

@msullivan
Copy link
Collaborator Author

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.

@gvanrossum
Copy link
Member

Ah, I see. But I'd still like to see fewer tests with different output.

Copy link
Member
@gvanrossum gvanrossum left a 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.)

@gvanrossum gvanrossum merged commit 42482e8 into error_flush Jan 9, 2018
@gvanrossum gvanrossum deleted the exit2 branch January 9, 2018 23:22
@gvanrossum
Copy link
Member

Whee!

@msullivan msullivan restored the exit2 branch January 9, 2018 23:35
@msullivan msullivan deleted the exit2 branch January 9, 2018 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0