1
0
mirror of https://github.com/mgechev/revive.git synced 2025-02-03 13:11:25 +02:00
revive/test/exported_test.go
Fagim Sadykov 8f9edc9fe7
#1002 - add "checkPublicInterface" option to "exported" rule to allow check documentation on public methods on public interfaces (#1003)
* [var-naming] handle private uppercased const

* FEATURE #1002 - "checkPublicInterface" option for "exported" rule - to check public interface method comments

* fix exported #1002 for ast.Ident

* fix exported #1002 for ast.Ident 2

* go fmt applyed

* #1002 update documentation on `exported` rule

* refactor `exported` rule configuration logic

* test and review fixes

---------

Co-authored-by: fregin <freginpanklinshtern@gmail.com>
2024-07-30 10:36:03 +02:00

33 lines
901 B
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})
}