You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thanks for the great work on revive. I checked the documentation and issues from var-naming, but couldn't find anything that explained this behavior. I'm unsure if it is intentional not to check exported test functions.
Describe the bug
The var-naming run doesn't run on exported test functions. i,e,. func TestValidIpAddress(t *testing.T). However, when unexporting the function it runs as expected.
To Reproduce
Steps to reproduce the behavior:
Open a new file named var_naming_test.go
Write the test function:
package main
import"testing"funcTestValidIp(t*testing.T) {
t.Fatal("not implemented")
}
Run revive (with the default settings), i.e. revive ./... && echo $?
Expected behavior
It should have failed because of the wrong casing in the function name. i.e.,
var_naming_test.go:5:6: func TestValidIp should be TestValidIP
For example, when unexporting the test function (testValidIp) the linter fails as expected.
Logs
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
OS: Linux
Version of Go: 1.22.9 / 1.23.3
Revive version: 1.5.0
Additional context
We first identified this issue in our CI environment (as part of golangci-lint) and I was able to reproduce it locally. Ref: etcd-io/etcd#18816 (comment)
The text was updated successfully, but these errors were encountered:
Hi, thanks for the great work on revive. I checked the documentation and issues from
var-naming
, but couldn't find anything that explained this behavior. I'm unsure if it is intentional not to check exported test functions.Describe the bug
The var-naming run doesn't run on exported test functions. i,e,.
func TestValidIpAddress(t *testing.T)
. However, when unexporting the function it runs as expected.To Reproduce
Steps to reproduce the behavior:
var_naming_test.go
revive
(with the default settings), i.e.revive ./... && echo $?
Expected behavior
It should have failed because of the wrong casing in the function name. i.e.,
For example, when unexporting the test function (
testValidIp
) the linter fails as expected.Logs
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
We first identified this issue in our CI environment (as part of
golangci-lint
) and I was able to reproduce it locally. Ref: etcd-io/etcd#18816 (comment)The text was updated successfully, but these errors were encountered: