Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore generated code #9

Closed
tamird opened this issue Nov 13, 2015 · 1 comment
Closed

ignore generated code #9

tamird opened this issue Nov 13, 2015 · 1 comment

Comments

@tamird
Copy link

tamird commented Nov 13, 2015

in CockroachDB we have a large amount of generated code, mostly from https://github.com/gogo/protobuf and yacc. Running gocyclo gives this:

$ gocyclo -top 10 .
645 parser (*sqlParserImpl).Parse sql/parser/yaccpar:156:1
233 roachpb (*RequestUnion).Unmarshal roachpb/api.pb.go:8930:1
233 roachpb (*ResponseUnion).Unmarshal roachpb/api.pb.go:9706:1
163 roachpb (*ErrorDetail).Unmarshal roachpb/errors.pb.go:2972:1
128 roachpb (*Transaction).Unmarshal roachpb/data.pb.go:2618:1
114 sql (*TableDescriptor).Unmarshal sql/structured.pb.go:1868:1
102 log (*LogEntry).Unmarshal util/log/log.pb.go:280:1
101 sql simplifyOneAndExpr sql/analyze.go:257:1
94 gossip (*Response).Unmarshal gossip/gossip.pb.go:796:1
93 gossip (*Request).Unmarshal gossip/gossip.pb.go:460:1

Of these, sql simplifyOneAndExpr sql/analyze.go:257 is the only hand-written function. To be useful, we need a way to teach gocyclo to ignore certain files, packages, or functions.

@jgautheron
Copy link

Just implemented an ignore flag for gocyclo.

$ gocyclo -ignore "yacc|\.pb\." .

Get it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants