Skip to content

Revive: cannot trigger rule "exported" #2263

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

Closed
4 tasks done
mattysweeps opened this issue Sep 28, 2021 · 1 comment
Closed
4 tasks done

Revive: cannot trigger rule "exported" #2263

mattysweeps opened this issue Sep 28, 2021 · 1 comment
Labels
duplicate This issue or pull request already exists question Further information is requested

Comments

@mattysweeps
Copy link

Welcome

  • Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).
  • Yes, I've tried with the standalone linter if available. (https://golangci-lint.run/usage/linters/)

Description of the problem

I cannot trigger the "exported" rule of the revive linter. Note: I think there might be more rules which are untriggerable, but I've tested and provided an example for the "exported" rule.

Version of golangci-lint

$ golangci-lint version
golangci-lint has version 1.42.1 built from 54f4301d on 2021-09-06T17:05:10Z

Configuration file

I've tried with no .golangci.yml config at all, no revive config, and the full config below:

$ cat .golangci.yml
linters:
  enable:
    - revive
issues:
  max-issues-per-linter: 0
  max-same-issues: 0
linters-settings:
  revive:
    ignore-generated-header: true
    severity: error
    confidence: 0.1
    error-code: -1
    warning-code: -1
    rules:
    - name: exported

Go environment

$ go version
go version go1.17.1 linux/amd64

Verbose output of running

$ golangci-lint cache clean
$ golangci-lint run -v
# paste output here

Code example or link to a public repository

Running revive by itself works on the example:

$ revive
example.go:5:1: exported function MyExample should have comment or be unexported

https://play.golang.org/p/yAMJITL7uBT

package example

import "fmt"

func MyExample() {
        fmt.Println("this function needs a comment")
}
@mattysweeps mattysweeps added the bug Something isn't working label Sep 28, 2021
@ldez ldez added duplicate This issue or pull request already exists question Further information is requested and removed bug Something isn't working labels Sep 28, 2021
@ldez
Copy link
Member

ldez commented Sep 28, 2021

Duplicate of #2114, #1937

@ldez ldez closed this as completed Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants