-
Notifications
You must be signed in to change notification settings - Fork 925
Audit exit codes #1977
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
Comments
I did a bit of digging in the related issues and found #1832. Peter (@scode)'s suggestion seems to be to exit with code 0 where we currently exit with 3 (i.e. for impossible-to-format code), and also to combine 1,2,4 into just 1... This seems to kind of make sense, but I'll have to think on it some more... |
The error code summary in OP is still correct for Relevant issues are #1080 and #1832 - which are both dealing with the long lines problem. There's also #1232 (and I believe there have been other issues) which are about having a 'check' mode for rustfmt where we only check whether a program would be reformatted by rustfmt, without actually reformatting anything. #1028 and #1976 are related since they both touch on write modes ('check' would be a new one). It seems to me that for exit codes, there are two use cases - regular use of rustfmt where the exit code is informational and CI usage where we want to know whether the program 'passes' rustfmt. Here is a proposal:
|
Follow-up: we should remove the Also, what about cases where Rustfmt tried and failed to format a line under the max width (i.e., not explicitly ignored and not ignored because it is a comment or macro, etc.)? I think in Do we also want to distinguish between code which is ignored and allowed to overrun and code which is ignored but should be manually formatted to not overrun? (I expect trailing whitespace to be treated similarly). |
cc @topecongiro on the above - sound good? |
Sounds good to me, thank you for summarizing!
If I understand correctly, those who want to ignore errors from comments or string lits could use
I agree that in both cases they should be considered as an error. On a side note, I think a very long ident should be considered as a non-error as well (cc #1448).
Personally I see no benefits on distinguishing those two. |
This is the only remaining work here |
Also #2707 |
I'm not sure exactly what to do about "by default" I think the user probably should opt-in with the config option. Otherwise, this is now implemented. |
Currently:
Can we do better? What is optimal for CI? (There are some issues filed about this sort of thing, would be good to look them up).
The text was updated successfully, but these errors were encountered: