1
0
mirror of https://github.com/mgechev/revive.git synced 2024-11-24 08:32:22 +02:00
revive/test/exported_test.go
Marcin Federowicz ff7b0adb4c
rule.exported: add feature to disable checking on const,method,function, variable (#1047)
Co-authored-by: chavacava <salvadorcavadini+github@gmail.com>
2024-10-02 10:46:52 +02:00

39 lines
1.2 KiB
Go

package test
import (
"testing"
"github.com/mgechev/revive/lint"
"github.com/mgechev/revive/rule"
)
func TestExportedWithDisableStutteringCheck(t *testing.T) {
args := []any{"disableStutteringCheck"}
testRule(t, "exported-issue-555", &rule.ExportedRule{}, &lint.RuleConfig{Arguments: args})
}
func TestExportedWithChecksOnMethodsOfPrivateTypes(t *testing.T) {
args := []any{"checkPrivateReceivers"}
testRule(t, "exported-issue-552", &rule.ExportedRule{}, &lint.RuleConfig{Arguments: args})
}
func TestExportedReplacingStuttersByRepetitive(t *testing.T) {
args := []any{"sayRepetitiveInsteadOfStutters"}
testRule(t, "exported-issue-519", &rule.ExportedRule{}, &lint.RuleConfig{Arguments: args})
}
func TestCheckPublicInterfaceOption(t *testing.T) {
args := []any{"checkPublicInterface"}
testRule(t, "exported-issue-1002", &rule.ExportedRule{}, &lint.RuleConfig{Arguments: args})
}
func TestCheckDisablingOnDeclarationTypes(t *testing.T) {
args := []any{"disableChecksOnConstants", "disableChecksOnFunctions", "disableChecksOnMethods", "disableChecksOnTypes", "disableChecksOnVariables"}
testRule(t, "exported-issue-1045", &rule.ExportedRule{}, &lint.RuleConfig{Arguments: args})
}