mirror of
https://github.com/mgechev/revive.git
synced 2025-11-29 22:28:23 +02:00
@@ -143,7 +143,7 @@ func (l *lintPackageComments) Visit(_ ast.Node) ast.Visitor {
|
||||
}
|
||||
}
|
||||
|
||||
if l.fileAst.Doc == nil {
|
||||
if isEmptyDoc(l.fileAst.Doc) {
|
||||
for _, failure := range l.checkPackageComment() {
|
||||
l.onFailure(failure)
|
||||
}
|
||||
@@ -162,3 +162,7 @@ func (l *lintPackageComments) Visit(_ ast.Node) ast.Visitor {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func isEmptyDoc(commentGroup *ast.CommentGroup) bool {
|
||||
return commentGroup == nil || commentGroup.Text() == ""
|
||||
}
|
||||
|
||||
2
testdata/golint/package_doc7.go
vendored
Normal file
2
testdata/golint/package_doc7.go
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
//nolint:dupl
|
||||
package foo
|
||||
Reference in New Issue
Block a user