mirror of
https://github.com/mgechev/revive.git
synced 2024-11-24 08:32:22 +02:00
90f51530cc
This PR introduces a white & black lists of initialisms for the `var-naming` rule. Now the rule can be configured with: ```toml [rule.var-naming] arguments = [["ID"], ["VM", "BAR"]] ``` This way, the linter will ignore `customId` but will throw on `customVm` or `customBar`. Fix #41
15 lines
285 B
Go
15 lines
285 B
Go
package test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/mgechev/revive/lint"
|
|
"github.com/mgechev/revive/rule"
|
|
)
|
|
|
|
func TestVarNaming(t *testing.T) {
|
|
testRule(t, "var-naming", &rule.VarNamingRule{}, &lint.RuleConfig{
|
|
Arguments: []interface{}{[]interface{}{"ID"}, []interface{}{"VM"}},
|
|
})
|
|
}
|