github.com/yoheimuta/protolint@v0.49.8-0.20240515023657-4ecaebb7575d/linter/visitor/baseVisitor.go (about) 1 package visitor 2 3 import ( 4 "github.com/yoheimuta/go-protoparser/v4/parser" 5 ) 6 7 // BaseVisitor represents a base visitor with noop logic. 8 type BaseVisitor struct{} 9 10 // OnStart works noop. 11 func (BaseVisitor) OnStart(*parser.Proto) error { return nil } 12 13 // Finally works noop. 14 func (BaseVisitor) Finally() error { return nil } 15 16 // VisitComment works noop. 17 func (BaseVisitor) VisitComment(*parser.Comment) {} 18 19 // VisitEmptyStatement works noop. 20 func (BaseVisitor) VisitEmptyStatement(*parser.EmptyStatement) (next bool) { return true } 21 22 // VisitEnum works noop. 23 func (BaseVisitor) VisitEnum(*parser.Enum) (next bool) { return true } 24 25 // VisitEnumField works noop. 26 func (BaseVisitor) VisitEnumField(*parser.EnumField) (next bool) { return true } 27 28 // VisitExtensions works noop. 29 func (BaseVisitor) VisitExtensions(*parser.Extensions) bool { return true } 30 31 // VisitExtend works noop. 32 func (BaseVisitor) VisitExtend(*parser.Extend) (next bool) { return true } 33 34 // VisitField works noop. 35 func (BaseVisitor) VisitField(*parser.Field) (next bool) { return true } 36 37 // VisitGroupField works noop. 38 func (BaseVisitor) VisitGroupField(*parser.GroupField) bool { return true } 39 40 // VisitImport works noop. 41 func (BaseVisitor) VisitImport(*parser.Import) (next bool) { return true } 42 43 // VisitMapField works noop. 44 func (BaseVisitor) VisitMapField(*parser.MapField) (next bool) { return true } 45 46 // VisitMessage works noop. 47 func (BaseVisitor) VisitMessage(*parser.Message) (next bool) { return true } 48 49 // VisitOneof works noop. 50 func (BaseVisitor) VisitOneof(*parser.Oneof) (next bool) { return true } 51 52 // VisitOneofField works noop. 53 func (BaseVisitor) VisitOneofField(*parser.OneofField) (next bool) { return true } 54 55 // VisitOption works noop. 56 func (BaseVisitor) VisitOption(*parser.Option) (next bool) { return true } 57 58 // VisitPackage works noop. 59 func (BaseVisitor) VisitPackage(*parser.Package) (next bool) { return true } 60 61 // VisitReserved works noop. 62 func (BaseVisitor) VisitReserved(*parser.Reserved) (next bool) { return true } 63 64 // VisitRPC works noop. 65 func (BaseVisitor) VisitRPC(*parser.RPC) (next bool) { return true } 66 67 // VisitService works noop. 68 func (BaseVisitor) VisitService(*parser.Service) (next bool) { return true } 69 70 // VisitSyntax works noop. 71 func (BaseVisitor) VisitSyntax(*parser.Syntax) (next bool) { return true }