Skip to content

revive: fix excludes #2005

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

Merged
merged 1 commit into from
May 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions pkg/config/issues.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,25 @@ var DefaultExcludePatterns = []ExcludePattern{
},
{
ID: "EXC0012",
Pattern: "exported (method|function|type|const) (.+) should have comment or be unexported",
Pattern: `exported (.+) should have comment or be unexported`,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, this pattern does not match the actual message from revive.

❯ golangci-lint --version
golangci-lint has version 1.41.0 built from eed344f6 on 2021-06-16T19:58:50Z

❯ golangci-lint run
main.go:16:2: exported: exported const XXX should have comment (or a comment on this block) or be unexported (revive)
	XXX = 0.1

@ldez Could you check that again?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a specific case for const in a group, I will fix that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in #2064

Linter: "revive",
Why: "Annoying issue about not having a comment. The rare codebase has such comments",
},
{
ID: "EXC0013",
Pattern: `package comment should be of the form "Package (.+) ..."`,
Pattern: `package comment should be of the form "(.+)...`,
Linter: "revive",
Why: "Annoying issue about not having a comment. The rare codebase has such comments",
},
{
ID: "EXC0014",
Pattern: `comment on exported (.+) should be of the form "(.+)..."`,
Linter: "revive",
Why: "Annoying issue about not having a comment. The rare codebase has such comments",
},
{
ID: "EXC0015",
Pattern: `should have a package comment, unless it's in another file for this package`,
Linter: "revive",
Why: "Annoying issue about not having a comment. The rare codebase has such comments",
},
Expand Down