2021-08-26 17:36:24 +02:00
|
|
|
package test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/mgechev/revive/lint"
|
|
|
|
"github.com/mgechev/revive/rule"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestExportedWithDisableStutteringCheck(t *testing.T) {
|
2023-09-24 08:44:02 +02:00
|
|
|
args := []any{"disableStutteringCheck"}
|
2021-08-26 17:36:24 +02:00
|
|
|
|
|
|
|
testRule(t, "exported-issue-555", &rule.ExportedRule{}, &lint.RuleConfig{Arguments: args})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestExportedWithChecksOnMethodsOfPrivateTypes(t *testing.T) {
|
2023-09-24 08:44:02 +02:00
|
|
|
args := []any{"checkPrivateReceivers"}
|
2021-08-26 17:36:24 +02:00
|
|
|
|
|
|
|
testRule(t, "exported-issue-552", &rule.ExportedRule{}, &lint.RuleConfig{Arguments: args})
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestExportedReplacingStuttersByRepetitive(t *testing.T) {
|
2023-09-24 08:44:02 +02:00
|
|
|
args := []any{"sayRepetitiveInsteadOfStutters"}
|
2021-08-26 17:36:24 +02:00
|
|
|
|
|
|
|
testRule(t, "exported-issue-519", &rule.ExportedRule{}, &lint.RuleConfig{Arguments: args})
|
|
|
|
}
|
2024-07-30 13:36:03 +05:00
|
|
|
|
|
|
|
func TestCheckPublicInterfaceOption(t *testing.T) {
|
|
|
|
args := []any{"checkPublicInterface"}
|
|
|
|
|
|
|
|
testRule(t, "exported-issue-1002", &rule.ExportedRule{}, &lint.RuleConfig{Arguments: args})
|
|
|
|
}
|
2024-10-02 10:46:52 +02:00
|
|
|
|
|
|
|
func TestCheckDisablingOnDeclarationTypes(t *testing.T) {
|
|
|
|
args := []any{"disableChecksOnConstants", "disableChecksOnFunctions", "disableChecksOnMethods", "disableChecksOnTypes", "disableChecksOnVariables"}
|
|
|
|
|
|
|
|
testRule(t, "exported-issue-1045", &rule.ExportedRule{}, &lint.RuleConfig{Arguments: args})
|
|
|
|
}
|