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

Duplicated findings for string-format when there is more than one scope provided for single argument #1063

Closed
zak-pawel opened this issue Oct 19, 2024 · 2 comments · Fixed by #1085

Comments

@zak-pawel
Copy link

Describe the bug
For string-format rule, when there is more than one scope provided for single argument there are duplicated findings in the results.
The number of findings is the same as the number of scopes provided in the configuration.

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:
# flags
revive -config revive.toml msg.go
# config file
[rule.string-format]
    arguments = [
        ["fmt.Errorf[0],errors.New[0]", "/^([^A-Z]|$)/", "must not start with a capital letter"],
    ]

msg.go:

package main

import (
	"errors"
)

func ReturnError() error {
	return errors.New("This is an error.")
}

Expected behavior
A single finding is found.

Expected behavior
Two findings are there:

msg.go:8:20: must not start with a capital letter
msg.go:8:20: must not start with a capital letter

Desktop (please complete the following information):

  • OS: Ubuntu 23.10
  • Version of Go: 1.23.0
@chavacava
Copy link
Collaborator

Hi @zak-pawel thanks for reporting the issue.

@zak-pawel
Copy link
Author

@chavacava
Great, thanks. It works as it should.
When can we expect the next release? Several nice fixes have been merged recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants