golangci / golangci-lint

Fast linters runner for Go
https://golangci-lint.run
GNU General Public License v3.0
15.27k stars 1.36k forks source link

Fix incorrect spacing handling in nolint directives #4561

Closed 796RCP92VZ closed 5 months ago

boring-cyborg[bot] commented 5 months ago

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

oschwald commented 5 months ago

The "additionally" part mentioned in the issue hit someone on my team today. They originally wrote //nolint: revive and running golangci-lint with --fix turned it into // nolint: revive, which made nolintlint fail. I have a vague memory of nolintlint or some other linter preventing the space before the linter name in the past, but maybe I am misremembering.

ldez commented 5 months ago

I put won't fix because:

  1. Your issue wants to lead to the same thing I already refused with your PR #4544.
  2. Some extra space cases are already fixed automatically, we have tests to prove that. (ex: // nolint:bob -> //nolint:bob)
  3. Your issue is a detail of a larger one (that we will not handle for now, intentionally, to avoid breaking changes)

The only thing we MAY do is create a nolintlint option to DETECT the invalid cases and create a report for them (a user should be able to enable/disable this behavior to avoid usage of exclude about them).

But this is not a "fix" for the incorrect spacing and this could not change the current behavior and the current supported syntax.

For me, your issue is off-topic by the goal it wants to achieve: "Fix incorrect spacing handling in nolint directives".

All those elements lead me to won't fix.

ldez commented 5 months ago

Sorry, but do you generate your answers with an AI?

You are writing a book with too many details each time, it's a bit discouraging to read.

If you are just a person who likes to write very long texts, don't take it badly, but I don't need an explanation about things that I already know, so you can go straight to the goal.

If you are using an AI, please generate a short answer.

I generated a summary of your comment with an AI:

The commenter acknowledges the larger issue at hand but argues for the value of implementing a specific improvement, suggesting a fix for a bug in the "nolint" tool. They emphasize that this improvement, while minor, would enhance user experience and align with the goals of linters. They express willingness to propose a design plan and implement the fix if deemed acceptable. Additionally, they express appreciation for the community's efforts and offer to contribute positively. The commenter also clarifies the goal of the fix and invites further discussion on the issue's scope and potential solutions.

ldez commented 5 months ago

It's been a bit frustrating that you respond immediately but ignore most of the content and dismiss what I'm saying

I think you have completely missed the meaning of my previous comment.

if you have time to respond immediately, you must surely have time to read more thoroughly and respond a little less promptly in exchange.

You are frustrated, I can understand but this sentence IS NOT ACCEPTABLE.

First warning.

ldez commented 5 months ago

We will not change nolint directives to follow strictly the convention. nolint directives should be considered frozen with their imperfections.

I already said here the only acceptable possibility.