Skip to content
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

Comment spacing isn't being ignored #1001

Open
Integralist opened this issue Jun 20, 2024 · 1 comment
Open

Comment spacing isn't being ignored #1001

Integralist opened this issue Jun 20, 2024 · 1 comment

Comments

@Integralist
Copy link

Integralist commented Jun 20, 2024

Describe the bug
I have defined a comment-spacings exclusion which isn't being respected

To Reproduce
Steps to reproduce the behavior:

  1. I updated revive go install github.com/mgechev/revive@latest
  2. I run it with the following flags & configuration file:
revive -config ~/revive.toml main.go
enableAllRules = true

[rule.comment-spacings]
arguments = ["lint:ignore"]

The result of which (among other errors in my file)...

main.go:13:1: no space between comment delimiter and comment text

Expected behavior
I expected the line //lint:ignore mnd to be ignored (I actually noticed this issue indirectly by revive via golangci-lint but was able to reproduce with revive directly).

Logs
Screenshot 2024-06-20 at 06 50 57

Note

Interestingly you'll see in the screenshot another comment line that does get ignored even though it shouldn't.

Desktop (please complete the following information):

  • OS: macOS Sonoma 14.4.1
  • Version of Go: go version go1.22.4 darwin/arm64

Additional context
Add any other context about the problem here.

I also tried modifying the config to use arguments = ["lint:"] rather than arguments = ["lint:ignore"] but that also didn't help.

@chavacava
Copy link
Collaborator

Hi @Integralist, thanks for reporting the problem (and sorry for the late response)
I'm not able to reproduce the bug with the later version of revive. Could you please check if you still reproduce it?

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

No branches or pull requests

2 participants