-
Notifications
You must be signed in to change notification settings - Fork 141
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
False negatives on compilation errors #113
Comments
I want to agree, but if someone runs Perhaps it's Just thinking out loud here. |
Yeah, I have a separate issue in vscode-go about this behaviour: In my opinion, it makes no sense to lint if compilation fails. Currently, vscode-go runs compilation and linting in parallel, which results in this happening. If vscode-go didn't do this, then this issue would go away entirely. That said, I still think the correct behaviour is to not report compilation errors. Maybe there should be a warning that gometalinter can ignore.
So that's potentially machine-readable. But if I do something syntatically correct, but semantically invalid, such as this: type x struct{ b int }
y := x{B: 1"} ...then
which is again different from by first comment, where it reported it as a linter error. Not sure why the discrepancy. |
gometalinter merges duplicate errors into a single line (if you pass it an optional flag, because deduplication disables streaming of output). If our output differs from that of other tools/the compiler, then we should fix that. That would be an easier change than modifying errcheck's general behaviour for errors. |
I'm all for improving the error messages to make it easier for other tools to parse. I'm not sure much can be done to silence the type checking errors (they're not compilation errors, they're from go/types), it's useful to report why the tool failed. |
We can completely silence them, but I feel it'd be too confusing to hide, or summarize, those errors, for the reason @shurcooL outlined. |
That's basically what I said in the second half of the sentence ;) |
Errcheck currently returns errors unrelated to error checking. Is it possible to remove these false negatives? Here's an example:
The code:
As you can see, the code has nothing to do with error checking. It doesn't make sense to get a compilation error from errcheck; it should only run on valid code, in my opinion.
This causes a lot of redundancy when running errcheck via gometalinter in Visual Studio Code, which combines compilation errors, linter errors and vet errors into one workflow. Every compilation error seems to also get its corresponding errcheck error.
The text was updated successfully, but these errors were encountered: