mgechev / revive

🔥 ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint
https://revive.run
MIT License
4.78k stars 279 forks source link

Comment spacing isn't being ignored #1001

Open Integralist opened 3 months ago

Integralist commented 3 months ago

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):

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.