-
Notifications
You must be signed in to change notification settings - Fork 646
Plugin reporting same error from many linters #1013
Comments
Interestingly the spurious output in this specific case disappears if one sets |
@daenney I'd prefer to get a fix for this from @alecthomas thoughts? |
This issue was moved to alecthomas/gometalinter#286 |
Note: Try the |
Personally, I'd recommend running I'm not sure how this plugin works, but I'd recommend the best approach to only run linters if the Go compiler was able to build the program. |
@bradleyfalzon Skipping linting when there are build errors is tracked in #600 Regardless of this, it is still useful to use |
Ah excellent.
Yes, agreed, I was more referring to Sorry I didn't mean to appear rude at all in any of my comments, I was more saying once the compiler errors are removed in #600, I don't believe any linter should share the exact same error text. But this all sounds good to me, I've heard nothing but great things from this plugin 👍 |
I disagree. There's plenty of things the linters can already tell me to fix before I even attempt to run a For example, it takes Linters can also be used to catch things that don't matter at all to a compiler, nor require a compiler to have run to transform the source code. They can even catch things that the compiler would get upset about. Forcing serialisation of compiler then linters, though in this case would result in the most correct error reporting, slows things down. |
@bradleyfalzon I didn't notice any rudeness at all :) @daenney Thanks for the detailed analysis. Note that the Go extension already uses Including @atombender for his thoughts in this discussion as he originally opened #600 Instead of serializing the build and linting process, another approach for #600 can be to not show linting results if there are build errors to begin with. And to control this with a setting. Serializing can result in delayed linting results in bigger projects. |
I'm not quite sure I follow. So as long as I'm not working on something that's declared as My reason for opening up this ticket is that I wanted a way to try and deduplicate the linter errors. I think I understand the reasoning behind "don't run linters if it doesn't compile" but I don't think that's a workflow that should be enforced, though having the option to do so or withhold the errors at first seems entirely reasonable. Linters can add value regardless of if the code is a valid construct according to the compiler; in this particular case they do an equally good yet far quicker job of finding the same problem. For me that improves the speed I can iterate on a code base, which I find valuable. I think this is mostly a matter of personal preference and therefor something that should be left up to the end user. |
For @mattetti The docs for
Oh definitely, for the purpose of this ticket using I personally don't do a lot of Go coding, so when there is an opportunity like this to discuss and understand the process more, I don't let go of that :)
Yes, when I do get around to working on #600, it would be via a setting and not enforced by default. |
I was under the impression that -i was also installing the executable when
building a main package. I might be wrong and it would be worth testing (on
my cellphone).
…On Sat, Jun 3, 2017, 13:25 Ramya Rao ***@***.***> wrote:
What's the reason for not running with -i by default
For go build -i part follow the discussion in #673
<#673>
For why we don't do that for "main" package, see #673 (comment)
<#673 (comment)>
specifically.
@mattetti <https://github.com/mattetti> The docs for go build -i says
"The -i flag installs the packages that are dependencies of the target". As
in only the dependencies are installed (if changed), in which case, do we
still have to skip the -i for the main package?
My reason for opening up this ticket is that I wanted a way to try and
deduplicate the linter errors. I think --aggregate gets us a long way there.
Oh definitely, for the purpose of this ticket using --aggregate solves
the problem, and I can add that as a default while running gometalinter.
I personally don't do a lot of Go coding, so when there is an opportunity
like this to discuss and understand the process more, I don't let go of
that :)
I understand the reasoning behind "don't run linters if it doesn't
compile" but I don't think that's a workflow that should be enforced
Yes, when I do get around to working on #600
<#600>, it would be via a
setting and not enforced by default.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1013 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAAcefG-Lmqk5u6ptMCvg02M9KI7WwWks5sAcFRgaJpZM4Npnxb>
.
|
There's some discussion about the "-i" flag here: #673. The documentation is pretty lacking.
… On Jun 3, 2017, at 17:10, Matt Aimonetti ***@***.***> wrote:
I was under the impression that -i was also installing the executable when
building a main package. I might be wrong and it would be worth testing (on
my cellphone).
On Sat, Jun 3, 2017, 13:25 Ramya Rao ***@***.***> wrote:
> What's the reason for not running with -i by default
>
> For go build -i part follow the discussion in #673
> <#673>
> For why we don't do that for "main" package, see #673 (comment)
> <#673 (comment)>
> specifically.
>
> @mattetti <https://github.com/mattetti> The docs for go build -i says
> "The -i flag installs the packages that are dependencies of the target". As
> in only the dependencies are installed (if changed), in which case, do we
> still have to skip the -i for the main package?
>
> My reason for opening up this ticket is that I wanted a way to try and
> deduplicate the linter errors. I think --aggregate gets us a long way there.
>
> Oh definitely, for the purpose of this ticket using --aggregate solves
> the problem, and I can add that as a default while running gometalinter.
>
> I personally don't do a lot of Go coding, so when there is an opportunity
> like this to discuss and understand the process more, I don't let go of
> that :)
>
> I understand the reasoning behind "don't run linters if it doesn't
> compile" but I don't think that's a workflow that should be enforced
>
> Yes, when I do get around to working on #600
> <#600>, it would be via a
> setting and not enforced by default.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#1013 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAAAcefG-Lmqk5u6ptMCvg02M9KI7WwWks5sAcFRgaJpZM4Npnxb>
> .
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Sorry, I now see that this issue was actually referenced above. |
Sounds good, @rakyll you might be interested in knowing that the flag documentation is a bit confusing :) |
Thanks for all the work on this @ramya-rao-a! 💯 |
In the latest update (0.6.62), |
When an issue is detected in a file it is reported in the problems tab by a number of linters gometalinter uses. This results in a tremendous amount of issues reported for what is only one thing:
The issue should be reproducible with a snippet like this:
And settings:
Though it matches with the output of every CLI reporting the issue it seems incorrect from the standpoint of the user, I should only be told about this error once. I would expect multiple errors for the same line at the same offset to get rolled up into one, especially if the error message is identical.
The text was updated successfully, but these errors were encountered: