1
0
mirror of https://github.com/mgechev/revive.git synced 2025-01-10 03:17:11 +02:00
revive/testdata/exported-issue-1002.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

24 lines
668 B
Go

// Package golint comment
package golint
// by default code bellow is valid,
// but if checkPublicInterface is switched on - it should check documentation in interfaces
// Some - some interface
type Some interface {
Other // should not fail
// Correct - should do all correct
Correct()
// MATCH /comment on exported interface method Some.SemiCorrect should be of the form "SemiCorrect ..."/
SemiCorrect()
NonCorrect() // MATCH /public interface method Some.NonCorrect should be commented/
}
// Other - just to check names compatibility
type Other interface {}
// for private interfaces it doesn't check docs anyway
type somePrivate interface {
AllGood()
}