1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-24 08:32:22 +02:00
revive/test/var-naming_test.go
Georgy Buranov 782f0f118c
variable to skip package name checks (#941)
* variable to skip package name checks

* add tests for skipPackageNameChecks

* Add documentation
2023-11-30 14:19:31 +01:00

28 lines
897 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: []any{[]any{"ID"}, []any{"VM"}},
})
testRule(t, "var-naming_test", &rule.VarNamingRule{}, &lint.RuleConfig{})
testRule(t, "var-naming_upperCaseConst-false", &rule.VarNamingRule{}, &lint.RuleConfig{})
testRule(t, "var-naming_upperCaseConst-true", &rule.VarNamingRule{}, &lint.RuleConfig{
Arguments: []any{[]any{}, []any{}, []any{map[string]any{"upperCaseConst": true}}},
})
testRule(t, "var-naming_skipPackageNameChecks-false", &rule.VarNamingRule{}, &lint.RuleConfig{})
testRule(t, "var-naming_skipPackageNameChecks-true", &rule.VarNamingRule{}, &lint.RuleConfig{
Arguments: []any{[]any{}, []any{}, []any{map[string]any{"skipPackageNameChecks": true}}},
})
}