openconfig / goyang

YANG parser and compiler to produce Go language objects
Apache License 2.0
221 stars 86 forks source link

linting issues #57

Open fredericfran-rvb opened 7 years ago

fredericfran-rvb commented 7 years ago

Is it possible to start linting this project as I get this long list of issues with it: starting the lint process... pkg/yang/entry.go:325:1:warning: depth is unused (deadcode) pkg/yang/entry_test.go:1154::error: arg dir for printf verb %s of wrong type: map[string]yang.Entry (vet) pkg/yang/node.go:305::error: missing argument for Fprintf("%s"): format reads arg 3, have only 2 args (vet) pkg/yang/node.go:334::error: missing argument for Fprintf("%s"): format reads arg 3, have only 2 args (vet) pkg/yang/node.go:343::error: arg i for printf verb %s of wrong type: int (vet) proto.go:275:1:warning: receiver name m should be consistent with previous receiver name mi for messageInfo (golint) proto.go:638:41:warning: error strings should not be capitalized or end with punctuation or a newline (golint) proto.go:650:41:warning: error strings should not be capitalized or end with punctuation or a newline (golint) pkg/yang/lex_test.go:38:29:warning: exported func T returns unexported type yang.token, which can be annoying to use (golint) pkg/yang/modules.go:241:28:warning: error strings should not be capitalized or end with punctuation or a newline (golint) pkg/yang/node.go:56:1:warning: exported method ErrorNode.Kind should have comment or be unexported (golint) pkg/yang/node.go:57:1:warning: exported method ErrorNode.ParentNode should have comment or be unexported (golint) pkg/yang/node.go:58:1:warning: exported method ErrorNode.NName should have comment or be unexported (golint) pkg/yang/node.go:59:1:warning: exported method ErrorNode.Statement should have comment or be unexported (golint) pkg/yang/node.go:60:1:warning: exported method ErrorNode.Exts should have comment or be unexported (golint) pkg/yang/parse.go:73:1:warning: exported method Statement.NName should have comment or be unexported (golint) pkg/yang/parse.go:74:1:warning: exported method Statement.Kind should have comment or be unexported (golint) pkg/yang/parse.go:75:1:warning: exported method Statement.Statement should have comment or be unexported (golint) pkg/yang/parse.go:76:1:warning: exported method Statement.ParentNode should have comment or be unexported (golint) pkg/yang/parse.go:77:1:warning: exported method Statement.Exts should have comment or be unexported (golint) pkg/yang/types_builtin.go:35:2:warning: exported const Ynone should have comment (or a comment on this block) or be unexported (golint) pkg/yang/types_builtin.go:58:5:warning: exported var TypeKindFromName should have comment or be unexported (golint) pkg/yang/types_builtin.go:81:5:warning: exported var TypeKindToName should have comment or be unexported (golint) pkg/yang/types_builtin.go:248:6:warning: type name will be used as yang.YangType by other packages, and that stutters; consider calling this Type (golint) pkg/yang/types_builtin.go:453:2:warning: exported const MaxInt64 should have comment (or a comment on this block) or be unexported (golint) pkg/yang/types_builtin.go:461:6:warning: exported type NumberKind should have comment or be unexported (golint) pkg/yang/types_builtin.go:464:2:warning: exported const Positive should have comment (or a comment on this block) or be unexported (golint) pkg/yang/types_builtin.go:616:6:warning: type name will be used as yang.YangRange by other packages, and that stutters; consider calling this Range (golint) pkg/yang/yang.go:55:1:warning: receiver name v should be consistent with previous receiver name s for Value (golint) pkg/yang/yang.go:81:1:warning: receiver name v should be consistent with previous receiver name s for Value (golint) pkg/yang/yang.go:98:1:warning: receiver name v should be consistent with previous receiver name s for Value (golint) pkg/yang/yang.go:156:1:warning: exported method Module.Kind should have comment or be unexported (golint) pkg/yang/yang.go:162:1:warning: exported method Module.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:163:1:warning: exported method Module.NName should have comment or be unexported (golint) pkg/yang/yang.go:164:1:warning: exported method Module.Statement should have comment or be unexported (golint) pkg/yang/yang.go:165:1:warning: exported method Module.Exts should have comment or be unexported (golint) pkg/yang/yang.go:166:1:warning: exported method Module.Groupings should have comment or be unexported (golint) pkg/yang/yang.go:167:1:warning: exported method Module.Typedefs should have comment or be unexported (golint) pkg/yang/yang.go:168:1:warning: exported method Module.Identities should have comment or be unexported (golint) pkg/yang/yang.go:193:1:warning: receiver name m should be consistent with previous receiver name s for Module (golint) pkg/yang/yang.go:202:1:warning: receiver name m should be consistent with previous receiver name s for Module (golint) pkg/yang/yang.go:230:1:warning: exported method Import.Kind should have comment or be unexported (golint) pkg/yang/yang.go:231:1:warning: exported method Import.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:232:1:warning: exported method Import.NName should have comment or be unexported (golint) pkg/yang/yang.go:233:1:warning: exported method Import.Statement should have comment or be unexported (golint) pkg/yang/yang.go:234:1:warning: exported method Import.Exts should have comment or be unexported (golint) pkg/yang/yang.go:250:1:warning: exported method Include.Kind should have comment or be unexported (golint) pkg/yang/yang.go:251:1:warning: exported method Include.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:252:1:warning: exported method Include.NName should have comment or be unexported (golint) pkg/yang/yang.go:253:1:warning: exported method Include.Statement should have comment or be unexported (golint) pkg/yang/yang.go:254:1:warning: exported method Include.Exts should have comment or be unexported (golint) pkg/yang/yang.go:267:1:warning: exported method Revision.Kind should have comment or be unexported (golint) pkg/yang/yang.go:268:1:warning: exported method Revision.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:269:1:warning: exported method Revision.NName should have comment or be unexported (golint) pkg/yang/yang.go:270:1:warning: exported method Revision.Statement should have comment or be unexported (golint) pkg/yang/yang.go:271:1:warning: exported method Revision.Exts should have comment or be unexported (golint) pkg/yang/yang.go:283:1:warning: exported method BelongsTo.Kind should have comment or be unexported (golint) pkg/yang/yang.go:284:1:warning: exported method BelongsTo.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:285:1:warning: exported method BelongsTo.NName should have comment or be unexported (golint) pkg/yang/yang.go:286:1:warning: exported method BelongsTo.Statement should have comment or be unexported (golint) pkg/yang/yang.go:287:1:warning: exported method BelongsTo.Exts should have comment or be unexported (golint) pkg/yang/yang.go:306:1:warning: exported method Typedef.Kind should have comment or be unexported (golint) pkg/yang/yang.go:307:1:warning: exported method Typedef.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:308:1:warning: exported method Typedef.NName should have comment or be unexported (golint) pkg/yang/yang.go:309:1:warning: exported method Typedef.Statement should have comment or be unexported (golint) pkg/yang/yang.go:310:1:warning: exported method Typedef.Exts should have comment or be unexported (golint) pkg/yang/yang.go:335:1:warning: exported method Type.Kind should have comment or be unexported (golint) pkg/yang/yang.go:336:1:warning: exported method Type.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:337:1:warning: exported method Type.NName should have comment or be unexported (golint) pkg/yang/yang.go:338:1:warning: exported method Type.Statement should have comment or be unexported (golint) pkg/yang/yang.go:339:1:warning: exported method Type.Exts should have comment or be unexported (golint) pkg/yang/yang.go:370:1:warning: exported method Container.Kind should have comment or be unexported (golint) pkg/yang/yang.go:371:1:warning: exported method Container.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:372:1:warning: exported method Container.NName should have comment or be unexported (golint) pkg/yang/yang.go:373:1:warning: exported method Container.Statement should have comment or be unexported (golint) pkg/yang/yang.go:374:1:warning: exported method Container.Exts should have comment or be unexported (golint) pkg/yang/yang.go:375:1:warning: exported method Container.Groupings should have comment or be unexported (golint) pkg/yang/yang.go:376:1:warning: exported method Container.Typedefs should have comment or be unexported (golint) pkg/yang/yang.go:391:1:warning: exported method Must.Kind should have comment or be unexported (golint) pkg/yang/yang.go:392:1:warning: exported method Must.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:393:1:warning: exported method Must.NName should have comment or be unexported (golint) pkg/yang/yang.go:394:1:warning: exported method Must.Statement should have comment or be unexported (golint) pkg/yang/yang.go:395:1:warning: exported method Must.Exts should have comment or be unexported (golint) pkg/yang/yang.go:417:1:warning: exported method Leaf.Kind should have comment or be unexported (golint) pkg/yang/yang.go:418:1:warning: exported method Leaf.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:419:1:warning: exported method Leaf.NName should have comment or be unexported (golint) pkg/yang/yang.go:420:1:warning: exported method Leaf.Statement should have comment or be unexported (golint) pkg/yang/yang.go:421:1:warning: exported method Leaf.Exts should have comment or be unexported (golint) pkg/yang/yang.go:445:1:warning: exported method LeafList.Kind should have comment or be unexported (golint) pkg/yang/yang.go:446:1:warning: exported method LeafList.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:447:1:warning: exported method LeafList.NName should have comment or be unexported (golint) pkg/yang/yang.go:448:1:warning: exported method LeafList.Statement should have comment or be unexported (golint) pkg/yang/yang.go:449:1:warning: exported method LeafList.Exts should have comment or be unexported (golint) pkg/yang/yang.go:484:1:warning: exported method List.Kind should have comment or be unexported (golint) pkg/yang/yang.go:485:1:warning: exported method List.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:486:1:warning: exported method List.NName should have comment or be unexported (golint) pkg/yang/yang.go:487:1:warning: exported method List.Statement should have comment or be unexported (golint) pkg/yang/yang.go:488:1:warning: exported method List.Exts should have comment or be unexported (golint) pkg/yang/yang.go:489:1:warning: exported method List.Groupings should have comment or be unexported (golint) pkg/yang/yang.go:490:1:warning: exported method List.Typedefs should have comment or be unexported (golint) pkg/yang/yang.go:516:1:warning: exported method Choice.Kind should have comment or be unexported (golint) pkg/yang/yang.go:517:1:warning: exported method Choice.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:518:1:warning: exported method Choice.NName should have comment or be unexported (golint) pkg/yang/yang.go:519:1:warning: exported method Choice.Statement should have comment or be unexported (golint) pkg/yang/yang.go:520:1:warning: exported method Choice.Exts should have comment or be unexported (golint) pkg/yang/yang.go:544:1:warning: exported method Case.Kind should have comment or be unexported (golint) pkg/yang/yang.go:545:1:warning: exported method Case.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:546:1:warning: exported method Case.NName should have comment or be unexported (golint) pkg/yang/yang.go:547:1:warning: exported method Case.Statement should have comment or be unexported (golint) pkg/yang/yang.go:548:1:warning: exported method Case.Exts should have comment or be unexported (golint) pkg/yang/yang.go:567:1:warning: exported method AnyXML.Kind should have comment or be unexported (golint) pkg/yang/yang.go:568:1:warning: exported method AnyXML.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:569:1:warning: exported method AnyXML.NName should have comment or be unexported (golint) pkg/yang/yang.go:570:1:warning: exported method AnyXML.Statement should have comment or be unexported (golint) pkg/yang/yang.go:571:1:warning: exported method AnyXML.Exts should have comment or be unexported (golint) pkg/yang/yang.go:593:1:warning: exported method AnyData.Kind should have comment or be unexported (golint) pkg/yang/yang.go:594:1:warning: exported method AnyData.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:595:1:warning: exported method AnyData.NName should have comment or be unexported (golint) pkg/yang/yang.go:596:1:warning: exported method AnyData.Statement should have comment or be unexported (golint) pkg/yang/yang.go:597:1:warning: exported method AnyData.Exts should have comment or be unexported (golint) pkg/yang/yang.go:623:1:warning: exported method Grouping.Kind should have comment or be unexported (golint) pkg/yang/yang.go:624:1:warning: exported method Grouping.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:625:1:warning: exported method Grouping.NName should have comment or be unexported (golint) pkg/yang/yang.go:626:1:warning: exported method Grouping.Statement should have comment or be unexported (golint) pkg/yang/yang.go:627:1:warning: exported method Grouping.Exts should have comment or be unexported (golint) pkg/yang/yang.go:628:1:warning: exported method Grouping.Groupings should have comment or be unexported (golint) pkg/yang/yang.go:629:1:warning: exported method Grouping.Typedefs should have comment or be unexported (golint) pkg/yang/yang.go:647:1:warning: exported method Uses.Kind should have comment or be unexported (golint) pkg/yang/yang.go:648:1:warning: exported method Uses.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:649:1:warning: exported method Uses.NName should have comment or be unexported (golint) pkg/yang/yang.go:650:1:warning: exported method Uses.Statement should have comment or be unexported (golint) pkg/yang/yang.go:651:1:warning: exported method Uses.Exts should have comment or be unexported (golint) pkg/yang/yang.go:671:1:warning: exported method Refine.Kind should have comment or be unexported (golint) pkg/yang/yang.go:672:1:warning: exported method Refine.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:673:1:warning: exported method Refine.NName should have comment or be unexported (golint) pkg/yang/yang.go:674:1:warning: exported method Refine.Statement should have comment or be unexported (golint) pkg/yang/yang.go:675:1:warning: exported method Refine.Exts should have comment or be unexported (golint) pkg/yang/yang.go:694:1:warning: exported method RPC.Kind should have comment or be unexported (golint) pkg/yang/yang.go:695:1:warning: exported method RPC.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:696:1:warning: exported method RPC.NName should have comment or be unexported (golint) pkg/yang/yang.go:697:1:warning: exported method RPC.Statement should have comment or be unexported (golint) pkg/yang/yang.go:698:1:warning: exported method RPC.Exts should have comment or be unexported (golint) pkg/yang/yang.go:699:1:warning: exported method RPC.Groupings should have comment or be unexported (golint) pkg/yang/yang.go:700:1:warning: exported method RPC.Typedefs should have comment or be unexported (golint) pkg/yang/yang.go:721:1:warning: exported method Input.Kind should have comment or be unexported (golint) pkg/yang/yang.go:722:1:warning: exported method Input.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:723:1:warning: exported method Input.NName should have comment or be unexported (golint) pkg/yang/yang.go:724:1:warning: exported method Input.Statement should have comment or be unexported (golint) pkg/yang/yang.go:725:1:warning: exported method Input.Exts should have comment or be unexported (golint) pkg/yang/yang.go:726:1:warning: exported method Input.Groupings should have comment or be unexported (golint) pkg/yang/yang.go:727:1:warning: exported method Input.Typedefs should have comment or be unexported (golint) pkg/yang/yang.go:748:1:warning: exported method Output.Kind should have comment or be unexported (golint) pkg/yang/yang.go:749:1:warning: exported method Output.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:750:1:warning: exported method Output.NName should have comment or be unexported (golint) pkg/yang/yang.go:751:1:warning: exported method Output.Statement should have comment or be unexported (golint) pkg/yang/yang.go:752:1:warning: exported method Output.Exts should have comment or be unexported (golint) pkg/yang/yang.go:753:1:warning: exported method Output.Groupings should have comment or be unexported (golint) pkg/yang/yang.go:754:1:warning: exported method Output.Typedefs should have comment or be unexported (golint) pkg/yang/yang.go:779:1:warning: exported method Notification.Kind should have comment or be unexported (golint) pkg/yang/yang.go:780:1:warning: exported method Notification.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:781:1:warning: exported method Notification.NName should have comment or be unexported (golint) pkg/yang/yang.go:782:1:warning: exported method Notification.Statement should have comment or be unexported (golint) pkg/yang/yang.go:783:1:warning: exported method Notification.Exts should have comment or be unexported (golint) pkg/yang/yang.go:784:1:warning: exported method Notification.Groupings should have comment or be unexported (golint) pkg/yang/yang.go:785:1:warning: exported method Notification.Typedefs should have comment or be unexported (golint) pkg/yang/yang.go:812:1:warning: exported method Augment.Kind should have comment or be unexported (golint) pkg/yang/yang.go:813:1:warning: exported method Augment.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:814:1:warning: exported method Augment.NName should have comment or be unexported (golint) pkg/yang/yang.go:815:1:warning: exported method Augment.Statement should have comment or be unexported (golint) pkg/yang/yang.go:816:1:warning: exported method Augment.Exts should have comment or be unexported (golint) pkg/yang/yang.go:832:1:warning: exported method Identity.Kind should have comment or be unexported (golint) pkg/yang/yang.go:833:1:warning: exported method Identity.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:834:1:warning: exported method Identity.NName should have comment or be unexported (golint) pkg/yang/yang.go:835:1:warning: exported method Identity.Statement should have comment or be unexported (golint) pkg/yang/yang.go:836:1:warning: exported method Identity.Exts should have comment or be unexported (golint) pkg/yang/yang.go:877:1:warning: exported method Extension.Kind should have comment or be unexported (golint) pkg/yang/yang.go:878:1:warning: exported method Extension.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:879:1:warning: exported method Extension.NName should have comment or be unexported (golint) pkg/yang/yang.go:880:1:warning: exported method Extension.Statement should have comment or be unexported (golint) pkg/yang/yang.go:881:1:warning: exported method Extension.Exts should have comment or be unexported (golint) pkg/yang/yang.go:893:1:warning: exported method Argument.Kind should have comment or be unexported (golint) pkg/yang/yang.go:894:1:warning: exported method Argument.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:895:1:warning: exported method Argument.NName should have comment or be unexported (golint) pkg/yang/yang.go:896:1:warning: exported method Argument.Statement should have comment or be unexported (golint) pkg/yang/yang.go:897:1:warning: exported method Argument.Exts should have comment or be unexported (golint) pkg/yang/yang.go:909:1:warning: exported method Element.Kind should have comment or be unexported (golint) pkg/yang/yang.go:910:1:warning: exported method Element.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:911:1:warning: exported method Element.NName should have comment or be unexported (golint) pkg/yang/yang.go:912:1:warning: exported method Element.Statement should have comment or be unexported (golint) pkg/yang/yang.go:913:1:warning: exported method Element.Exts should have comment or be unexported (golint) pkg/yang/yang.go:928:1:warning: exported method Feature.Kind should have comment or be unexported (golint) pkg/yang/yang.go:929:1:warning: exported method Feature.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:930:1:warning: exported method Feature.NName should have comment or be unexported (golint) pkg/yang/yang.go:931:1:warning: exported method Feature.Statement should have comment or be unexported (golint) pkg/yang/yang.go:932:1:warning: exported method Feature.Exts should have comment or be unexported (golint) pkg/yang/yang.go:946:1:warning: exported method Deviation.Kind should have comment or be unexported (golint) pkg/yang/yang.go:947:1:warning: exported method Deviation.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:948:1:warning: exported method Deviation.NName should have comment or be unexported (golint) pkg/yang/yang.go:949:1:warning: exported method Deviation.Statement should have comment or be unexported (golint) pkg/yang/yang.go:950:1:warning: exported method Deviation.Exts should have comment or be unexported (golint) pkg/yang/yang.go:970:1:warning: exported method Deviate.Kind should have comment or be unexported (golint) pkg/yang/yang.go:971:1:warning: exported method Deviate.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:972:1:warning: exported method Deviate.NName should have comment or be unexported (golint) pkg/yang/yang.go:973:1:warning: exported method Deviate.Statement should have comment or be unexported (golint) pkg/yang/yang.go:974:1:warning: exported method Deviate.Exts should have comment or be unexported (golint) pkg/yang/yang.go:989:1:warning: exported method Enum.Kind should have comment or be unexported (golint) pkg/yang/yang.go:990:1:warning: exported method Enum.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:991:1:warning: exported method Enum.NName should have comment or be unexported (golint) pkg/yang/yang.go:992:1:warning: exported method Enum.Statement should have comment or be unexported (golint) pkg/yang/yang.go:993:1:warning: exported method Enum.Exts should have comment or be unexported (golint) pkg/yang/yang.go:1008:1:warning: exported method Bit.Kind should have comment or be unexported (golint) pkg/yang/yang.go:1009:1:warning: exported method Bit.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:1010:1:warning: exported method Bit.NName should have comment or be unexported (golint) pkg/yang/yang.go:1011:1:warning: exported method Bit.Statement should have comment or be unexported (golint) pkg/yang/yang.go:1012:1:warning: exported method Bit.Exts should have comment or be unexported (golint) pkg/yang/yang.go:1027:1:warning: exported method Range.Kind should have comment or be unexported (golint) pkg/yang/yang.go:1028:1:warning: exported method Range.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:1029:1:warning: exported method Range.NName should have comment or be unexported (golint) pkg/yang/yang.go:1030:1:warning: exported method Range.Statement should have comment or be unexported (golint) pkg/yang/yang.go:1031:1:warning: exported method Range.Exts should have comment or be unexported (golint) pkg/yang/yang.go:1046:1:warning: exported method Length.Kind should have comment or be unexported (golint) pkg/yang/yang.go:1047:1:warning: exported method Length.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:1048:1:warning: exported method Length.NName should have comment or be unexported (golint) pkg/yang/yang.go:1049:1:warning: exported method Length.Statement should have comment or be unexported (golint) pkg/yang/yang.go:1050:1:warning: exported method Length.Exts should have comment or be unexported (golint) pkg/yang/yang.go:1065:1:warning: exported method Pattern.Kind should have comment or be unexported (golint) pkg/yang/yang.go:1066:1:warning: exported method Pattern.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:1067:1:warning: exported method Pattern.NName should have comment or be unexported (golint) pkg/yang/yang.go:1068:1:warning: exported method Pattern.Statement should have comment or be unexported (golint) pkg/yang/yang.go:1069:1:warning: exported method Pattern.Exts should have comment or be unexported (golint) pkg/yang/yang.go:1094:1:warning: exported method Action.Kind should have comment or be unexported (golint) pkg/yang/yang.go:1095:1:warning: exported method Action.ParentNode should have comment or be unexported (golint) pkg/yang/yang.go:1096:1:warning: exported method Action.NName should have comment or be unexported (golint) pkg/yang/yang.go:1097:1:warning: exported method Action.Statement should have comment or be unexported (golint) pkg/yang/yang.go:1098:1:warning: exported method Action.Exts should have comment or be unexported (golint) pkg/yang/yang.go:1099:1:warning: exported method Action.Groupings should have comment or be unexported (golint) pkg/yang/yang.go:1100:1:warning: exported method Action.Typedefs should have comment or be unexported (golint) protogen/protogen.go:50:1:warning: exported function GetProtoFlags should have comment or be unexported (golint) protogen/protogen.go:95:1:warning: exported function Generate should have comment or be unexported (golint) protogen/protogen.go:294:1:warning: receiver name m should be consistent with previous receiver name mi for messageInfo (golint) protogen/protogen.go:668:41:warning: error strings should not be capitalized or end with punctuation or a newline (golint) protogen/protogen.go:680:41:warning: error strings should not be capitalized or end with punctuation or a newline (golint) treegen/treegen.go:34:1:warning: exported function Generate should have comment or be unexported (golint) typesgen/typesgen.go:43:1:warning: exported function Generate should have comment or be unexported (golint) pkg/yang/ast.go:236::warning: line is 173 characters (lll) pkg/yang/entry_test.go:1160::warning: line is 179 characters (lll) results/ietf_interfaces_2014_05_08.pb.go:111::warning: line is 202 characters (lll) results/ietf_interfaces_2014_05_08.pb.go:117::warning: line is 198 characters (lll) results/ietf_interfaces_2014_05_08.pb.go:332::warning: line is 165 characters (lll) results/ietf_interfaces_2014_05_08.pb.go:333::warning: line is 162 characters (lll) proto.go:407::warning: cyclomatic complexity 44 of function (protofile).printNode() is high (> 10) (gocyclo) proto.go:80::warning: cyclomatic complexity 25 of function doProto() is high (> 10) (gocyclo) yang.go:129::warning: cyclomatic complexity 21 of function main() is high (> 10) (gocyclo) tree.go:44::warning: cyclomatic complexity 20 of function Write() is high (> 10) (gocyclo) types.go:77::warning: cyclomatic complexity 18 of function printType() is high (> 10) (gocyclo) proto.go:354::warning: cyclomatic complexity 15 of function (protofile).printService() is high (> 10) (gocyclo) pkg/yang/entry.go:333::warning: cyclomatic complexity 94 of function ToEntry() is high (> 10) (gocyclo) pkg/yang/types.go:161::warning: cyclomatic complexity 59 of function (Type).resolve() is high (> 10) (gocyclo) pkg/yang/ast.go:256::warning: cyclomatic complexity 37 of function initTypes() is high (> 10) (gocyclo) pkg/yang/identity_test.go:407::warning: cyclomatic complexity 29 of function TestIdentityTree() is high (> 10) (gocyclo) pkg/yang/ast.go:90::warning: cyclomatic complexity 28 of function build() is high (> 10) (gocyclo) pkg/yang/ast_test.go:43::warning: cyclomatic complexity 22 of function (MainNode).checkEqual() is high (> 10) (gocyclo) pkg/yang/lex.go:410::warning: cyclomatic complexity 21 of function lexQString() is high (> 10) (gocyclo) pkg/yang/node.go:141::warning: cyclomatic complexity 21 of function FindNode() is high (> 10) (gocyclo) pkg/yang/entry.go:769::warning: cyclomatic complexity 18 of function (Entry).Find() is high (> 10) (gocyclo) pkg/yang/node.go:237::warning: cyclomatic complexity 16 of function ChildNode() is high (> 10) (gocyclo) pkg/yang/camelcase.go:38::warning: cyclomatic complexity 15 of function CamelCase() is high (> 10) (gocyclo) pkg/yang/find.go:50::warning: cyclomatic complexity 14 of function FindGrouping() is high (> 10) (gocyclo) pkg/yang/node.go:301::warning: cyclomatic complexity 14 of function PrintNode() is high (> 10) (gocyclo) pkg/yang/modules.go:317::warning: cyclomatic complexity 14 of function (Modules).Process() is high (> 10) (gocyclo) pkg/yang/parse.go:270::warning: cyclomatic complexity 14 of function (parser).nextStatement() is high (> 10) (gocyclo) pkg/yang/parse.go:114::warning: cyclomatic complexity 13 of function (Statement).Write() is high (> 10) (gocyclo) pkg/yang/parse.go:220::warning: cyclomatic complexity 13 of function (parser).next() is high (> 10) (gocyclo) pkg/yang/entry_test.go:840::warning: cyclomatic complexity 12 of function TestActionRPC() is high (> 10) (gocyclo) pkg/yang/file.go:129::warning: cyclomatic complexity 12 of function findInDir() is high (> 10) (gocyclo) pkg/yang/types_builtin.go:760::warning: cyclomatic complexity 12 of function (YangRange).Contains() is high (> 10) (gocyclo) pkg/yang/entry.go:945::warning: cyclomatic complexity 12 of function (sortedErrors).Less() is high (> 10) (gocyclo) pkg/yang/types_builtin.go:577::warning: cyclomatic complexity 11 of function (Number).Less() is high (> 10) (gocyclo) pkg/yang/parse_test.go:56::warning: cyclomatic complexity 11 of function TestParse() is high (> 10) (gocyclo) pkg/yang/identity_test.go:101::warning: cyclomatic complexity 11 of function TestIdentityExtract() is high (> 10) (gocyclo) pkg/yang/entry_test.go:486::warning: cyclomatic complexity 11 of function TestFullModuleProcess() is high (> 10) (gocyclo) pkg/yang/entry_test.go:753::warning: cyclomatic complexity 11 of function TestAnyDataAnyXML() is high (> 10) (gocyclo) pkg/yang/types_test.go:22::warning: cyclomatic complexity 11 of function TestTypeResolve() is high (> 10) (gocyclo) pkg/yang/entry.go:130::warning: cyclomatic complexity 11 of function (Entry).Print() is high (> 10) (gocyclo) protogen/protogen.go:426::warning: cyclomatic complexity 46 of function (protofile).printNode() is high (> 10) (gocyclo) protogen/protogen.go:99::warning: cyclomatic complexity 25 of function doProto() is high (> 10) (gocyclo) protogen/protogen.go:373::warning: cyclomatic complexity 15 of function (protofile).printService() is high (> 10) (gocyclo) sysrepogen/sysrepogen.go:91::warning: cyclomatic complexity 21 of function doSysrepo() is high (> 10) (gocyclo) sysrepogen/sysrepogen.go:325::warning: cyclomatic complexity 18 of function (*protofile).printNode() is high (> 10) (gocyclo) treegen/treegen.go:45::warning: cyclomatic complexity 20 of function Write() is high (> 10) (gocyclo) typesgen/typesgen.go:80::warning: cyclomatic complexity 18 of function printType() is high (> 10) (gocyclo) pkg/yang/file.go:52::warning: Errors unhandled.,LOW,HIGH (gas) pkg/yang/lex.go:176::warning: Errors unhandled.,LOW,HIGH (gas) pkg/yang/lex.go:192::warning: Errors unhandled.,LOW,HIGH (gas) pkg/yang/lex.go:311::warning: Errors unhandled.,LOW,HIGH (gas) pkg/yang/lex.go:313::warning: Errors unhandled.,LOW,HIGH (gas) pkg/yang/lex.go:314::warning: Errors unhandled.,LOW,HIGH (gas) pkg/yang/lex.go:317::warning: Errors unhandled.,LOW,HIGH (gas) pkg/yang/lex.go:340::warning: Errors unhandled.,LOW,HIGH (gas) pkg/yang/lex.go:343::warning: Errors unhandled.,LOW,HIGH (gas) pkg/yang/types.go:174:2:warning: ineffectual assignment to source (ineffassign) pkg/yang/types_builtin.go:777:6:warning: ineffectual assignment to ok (ineffassign) pkg/yang/entry.go:574:8:warning: 2 other occurrence(s) of "leaf" found in: node.go:215:20 yang.go:417:48 (goconst) pkg/yang/node.go:215:20:warning: 2 other occurrence(s) of "leaf" found in: entry.go:574:8 yang.go:417:48 (goconst) pkg/yang/yang.go:417:48:warning: 2 other occurrence(s) of "leaf" found in: entry.go:574:8 node.go:215:20 (goconst) pkg/yang/entry.go:594:8:warning: 2 other occurrence(s) of "rpc" found in: node.go:201:18 yang.go:694:48 (goconst) pkg/yang/node.go:201:18:warning: 2 other occurrence(s) of "rpc" found in: entry.go:594:8 yang.go:694:48 (goconst) pkg/yang/yang.go:694:48:warning: 2 other occurrence(s) of "rpc" found in: entry.go:594:8 node.go:201:18 (goconst) pkg/yang/entry.go:514:8:warning: 2 other occurrence(s) of "choice" found in: node.go:215:10 yang.go:516:50 (goconst) pkg/yang/node.go:215:10:warning: 2 other occurrence(s) of "choice" found in: entry.go:514:8 yang.go:516:50 (goconst) pkg/yang/yang.go:516:50:warning: 2 other occurrence(s) of "choice" found in: entry.go:514:8 node.go:215:10 (goconst) pkg/yang/node.go:251:12:warning: 2 other occurrence(s) of "nomerge" found in: node.go:315:12 ast.go:291:14 (goconst) pkg/yang/node.go:315:12:warning: 2 other occurrence(s) of "nomerge" found in: node.go:251:12 ast.go:291:14 (goconst) pkg/yang/ast.go:291:14:warning: 2 other occurrence(s) of "nomerge" found in: node.go:251:12 node.go:315:12 (goconst) pkg/yang/modules.go:130:7:warning: 3 other occurrence(s) of "submodule" found in: node.go:111:7 node.go:167:20 yang.go:158:10 (goconst) pkg/yang/node.go:111:7:warning: 3 other occurrence(s) of "submodule" found in: modules.go:130:7 node.go:167:20 yang.go:158:10 (goconst) pkg/yang/node.go:167:20:warning: 3 other occurrence(s) of "submodule" found in: modules.go:130:7 node.go:111:7 yang.go:158:10 (goconst) pkg/yang/yang.go:158:10:warning: 3 other occurrence(s) of "submodule" found in: modules.go:130:7 node.go:111:7 node.go:167:20 (goconst) pkg/yang/entry.go:57:10:warning: 2 other occurrence(s) of "true" found in: entry.go:364:9 yang.go:87:7 (goconst) pkg/yang/entry.go:364:9:warning: 2 other occurrence(s) of "true" found in: entry.go:57:10 yang.go:87:7 (goconst) pkg/yang/yang.go:87:7:warning: 2 other occurrence(s) of "true" found in: entry.go:57:10 entry.go:364:9 (goconst) pkg/yang/entry.go:510:8:warning: 2 other occurrence(s) of "case" found in: node.go:215:28 yang.go:544:48 (goconst) pkg/yang/node.go:215:28:warning: 2 other occurrence(s) of "case" found in: entry.go:510:8 yang.go:544:48 (goconst) pkg/yang/yang.go:544:48:warning: 2 other occurrence(s) of "case" found in: entry.go:510:8 node.go:215:28 (goconst) pkg/yang/entry.go:602:8:warning: 2 other occurrence(s) of "input" found in: entry.go:608:24 yang.go:721:50 (goconst) pkg/yang/entry.go:608:24:warning: 2 other occurrence(s) of "input" found in: entry.go:602:8 yang.go:721:50 (goconst) pkg/yang/yang.go:721:50:warning: 2 other occurrence(s) of "input" found in: entry.go:602:8 entry.go:608:24 (goconst) pkg/yang/modules.go:128:7:warning: 2 other occurrence(s) of "module" found in: node.go:107:7 yang.go:160:9 (goconst) pkg/yang/node.go:107:7:warning: 2 other occurrence(s) of "module" found in: modules.go:128:7 yang.go:160:9 (goconst) pkg/yang/yang.go:160:9:warning: 2 other occurrence(s) of "module" found in: modules.go:128:7 node.go:107:7 (goconst) pkg/yang/node.go:71:9:warning: 2 other occurrence(s) of "unknown" found in: parse.go:100:10 types.go:174:12 (goconst) pkg/yang/parse.go:100:10:warning: 2 other occurrence(s) of "unknown" found in: node.go:71:9 types.go:174:12 (goconst) pkg/yang/types.go:174:12:warning: 2 other occurrence(s) of "unknown" found in: node.go:71:9 parse.go:100:10 (goconst) pkg/yang/entry.go:59:10:warning: 2 other occurrence(s) of "false" found in: entry.go:366:9 yang.go:89:7 (goconst) pkg/yang/entry.go:366:9:warning: 2 other occurrence(s) of "false" found in: entry.go:59:10 yang.go:89:7 (goconst) pkg/yang/yang.go:89:7:warning: 2 other occurrence(s) of "false" found in: entry.go:59:10 entry.go:366:9 (goconst) pkg/yang/entry.go:611:8:warning: 2 other occurrence(s) of "output" found in: entry.go:617:25 yang.go:748:51 (goconst) pkg/yang/entry.go:617:25:warning: 2 other occurrence(s) of "output" found in: entry.go:611:8 yang.go:748:51 (goconst) pkg/yang/yang.go:748:51:warning: 2 other occurrence(s) of "output" found in: entry.go:611:8 entry.go:617:25 (goconst) pkg/yang/entry.go:624:8:warning: 2 other occurrence(s) of "uses" found in: node.go:267:18 yang.go:647:48 (goconst) pkg/yang/node.go:267:18:warning: 2 other occurrence(s) of "uses" found in: entry.go:624:8 yang.go:647:48 (goconst) pkg/yang/yang.go:647:48:warning: 2 other occurrence(s) of "uses" found in: entry.go:624:8 node.go:267:18 (goconst) proto.go:304:59:warning: "presense" is a misspelling of "presence" (misspell) proto.go:657:65:warning: "decendents" is a misspelling of "descendants" (misspell) types.go:63:48:warning: "decendents" is a misspelling of "descendants" (misspell) pkg/yang/ast.go:210:3:warning: "exeptional" is a misspelling of "exceptional" (misspell) pkg/yang/ast.go:329:47:warning: "actaully" is a misspelling of "actually" (misspell) pkg/yang/ast_test.go:315:29:warning: "absense" is a misspelling of "absence" (misspell) pkg/yang/doc.go:22:37:warning: "retuns" is a misspelling of "returns" (misspell) pkg/yang/entry.go:74:61:warning: "encounterd" is a misspelling of "encountered" (misspell) pkg/yang/entry.go:283:38:warning: "dupicate" is a misspelling of "duplicate" (misspell) pkg/yang/modules.go:99:60:warning: "searchs" is a misspelling of "searches" (misspell) pkg/yang/node.go:88:41:warning: "statment" is a misspelling of "statement" (misspell) pkg/yang/node.go:90:47:warning: "statment" is a misspelling of "statement" (misspell) pkg/yang/parse.go:19:32:warning: "Statment" is a misspelling of "Statement" (misspell) pkg/yang/parse_test.go:38:16:warning: "statment" is a misspelling of "statement" (misspell) pkg/yang/parse_test.go:48:15:warning: "statment" is a misspelling of "statement" (misspell) pkg/yang/types_builtin.go:495:13:warning: "hexidecimal" is a misspelling of "hexadecimal" (misspell) protogen/protogen.go:323:59:warning: "presense" is a misspelling of "presence" (misspell) protogen/protogen.go:687:65:warning: "decendents" is a misspelling of "descendants" (misspell) yang.go:61:2:warning: typesDebug redeclared in this block (interfacer) types.go:28:2:warning: other declaration of typesDebug (interfacer) yang.go:62:2:warning: typesVerbose redeclared in this block (interfacer) types.go:29:2:warning: other declaration of typesVerbose (interfacer) typesgen/typesgen.go:66:48:warning: "decendents" is a misspelling of "descendants" (misspell) tree.go:1::warning: file is not goimported (goimports) yang.go:61:2:warning: typesDebug redeclared in this block (unconvert) types.go:28:2:warning: other declaration of typesDebug (unconvert) yang.go:62:2:warning: typesVerbose redeclared in this block (unconvert) types.go:29:2:warning: other declaration of typesVerbose (unconvert) yang.go:61:2:warning: unused struct field typesDebug redeclared in this block (structcheck) types.go:28:2:warning: unused struct field other declaration of typesDebug (structcheck) yang.go:62:2:warning: unused struct field typesVerbose redeclared in this block (structcheck) types.go:29:2:warning: unused struct field other declaration of typesVerbose (structcheck) yang.go:61:2:warning: error return value not checked (typesDebug redeclared in this block) (errcheck) types.go:28:2:warning: error return value not checked (other declaration of typesDebug) (errcheck) yang.go:62:2:warning: error return value not checked (typesVerbose redeclared in this block) (errcheck) types.go:29:2:warning: error return value not checked (other declaration of typesVerbose) (errcheck) pkg/yang/marshal_test.go:22:2:warning: error return value not checked (could not import github.com/kylelemons/godebug/pretty (cannot find package "github.com/kylelemons/godebug/pretty" in any of:) (errcheck) pkg/yang/marshal_test.go:273:14:warning: error return value not checked (undeclared name: pretty) (errcheck) pkg/yang/marshal_test.go:590:17:warning: error return value not checked (undeclared name: pretty) (errcheck) yang.go:61:2:warning: typesDebug redeclared in this block (gosimple) types.go:28:2:warning: other declaration of typesDebug (gosimple) yang.go:62:2:warning: typesVerbose redeclared in this block (gosimple) types.go:29:2:warning: other declaration of typesVerbose (gosimple) pkg/yang/marshal_test.go:22:2:warning: could not import github.com/kylelemons/godebug/pretty (cannot find package "github.com/kylelemons/godebug/pretty" in any of: (gosimple) pkg/yang/marshal_test.go:273:14:warning: undeclared name: pretty (gosimple) pkg/yang/marshal_test.go:590:17:warning: undeclared name: pretty (gosimple) yang.go:61:2:warning: unused variable or constant typesDebug redeclared in this block (varcheck) types.go:28:2:warning: unused variable or constant other declaration of typesDebug (varcheck) yang.go:62:2:warning: unused variable or constant typesVerbose redeclared in this block (varcheck) types.go:29:2:warning: unused variable or constant other declaration of typesVerbose (varcheck) pkg/yang/marshal_test.go:22:2:warning: unused variable or constant could not import github.com/kylelemons/godebug/pretty (cannot find package "github.com/kylelemons/godebug/pretty" in any of: (varcheck) pkg/yang/marshal_test.go:273:14:warning: unused variable or constant undeclared name: pretty (varcheck) pkg/yang/marshal_test.go:590:17:warning: unused variable or constant undeclared name: pretty (varcheck) yang.go:61:2:warning: typesDebug redeclared in this block (staticcheck) types.go:28:2:warning: other declaration of typesDebug (staticcheck) yang.go:62:2:warning: typesVerbose redeclared in this block (staticcheck) types.go:29:2:warning: other declaration of typesVerbose (staticcheck) pkg/yang/marshal_test.go:22:2:warning: could not import github.com/kylelemons/godebug/pretty (cannot find package "github.com/kylelemons/godebug/pretty" in any of: (staticcheck) pkg/yang/marshal_test.go:273:14:warning: undeclared name: pretty (staticcheck) pkg/yang/marshal_test.go:590:17:warning: undeclared name: pretty (staticcheck) pkg/yang/camelcase.go:1::warning: file is not goimported (goimports) The lint process has exited with status code 1, view the log for more details.

pborman commented 7 years ago

Some of the errors are legitimate (and should be addressed), but many of them are not helpful, such as all the ones that say:

pkg/yang/yang.go:1100:1⚠️ exported method Action.Typedefs should have comment or be unexported (golint)

The only reason to add comments to these hundreds of methods is to satisfy a linter rather than actually improve readability or resolve an actual issue.

The goconst checks seem to be style based, and I am not sure I would want to deal with the gocyclo checks, which also seem subjective.

It looks like you are missing the github.com/kylelemons/godebug/pretty in your source tree.

The formatting issues (wrong number of arguments) probably need addressing, and the spelling issues should be fixed.

A more reasonable set of linter options would probably be appropriate.

andaru commented 7 years ago

It would be fantastic if we could keep the incorrect spelling of "descendents", just because they're a great band :).

Cheers, Andrew

On Wed, Jul 19, 2017 at 10:16 AM, pborman notifications@github.com wrote:

Some of the errors are legitimate (and should be addressed), but many of them are not helpful, such as all the ones that say:

pkg/yang/yang.go:1100:1⚠️ exported method Action.Typedefs should have comment or be unexported (golint)

The only reason to add comments to these hundreds of methods is to satisfy a linter rather than actually improve readability or resolve an actual issue.

The goconst checks seem to be style based, and I am not sure I would want to deal with the gocyclo checks, which also seem subjective.

It looks like you are missing the github.com/kylelemons/godebug/pretty in your source tree.

The formatting issues (wrong number of arguments) probably need addressing, and the spelling issues should be fixed.

A more reasonable set of linter options would probably be appropriate.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openconfig/goyang/issues/57#issuecomment-316455776, or mute the thread https://github.com/notifications/unsubscribe-auth/AAp2R0dqRBUb547Xxv6dlrb4yyClF1oUks5sPjnhgaJpZM4Oc_uD .

pborman commented 7 years ago

Sadly, I fixed that along with the others, Andrew.

I merged a pull request that addressed the format string errors (%s was doubled in a few places) as well as address misspellings.

pborman commented 7 years ago

The single long comment line has been reformatted. The other results from lll are not helpful.

The results from errcheck, goconst, gocyclo, ineffassign, and golint are not helpful.

Other errors appear to be local issues and not in the repository.

fredericfran-rvb commented 7 years ago

@pborman thanks for comments and effort with modifying the code, much appreciated.

Do you think it will be useful to modify the README.md file so that it helps a newcomer get to speed into using goyang? E.g. The formatters do not seem to be activated by default using the main yang.go file. I think it would be much more user-friendly to provide some examples of cmds that you can run with goyang.