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

Add gocyclo and golint into gometalinter #31

Closed
jimexist opened this issue Nov 17, 2017 · 9 comments
Closed

Add gocyclo and golint into gometalinter #31

jimexist opened this issue Nov 17, 2017 · 9 comments
Assignees
Labels
area/test kind/enhancement Categorizes issue or PR as related to enhancement. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Milestone

Comments

@jimexist
Copy link
Contributor

What is the issue about:
Adding more linter coverage.

What happened:
Golint and gocyclo could not be added because there are some pending fixes to be made.

What you expected to happen:
See lint errors.

Anything else we need to know:
@caicloud/review-framework esp. the router implementations, there are some complex functions that need to be refactored.

@jimexist
Copy link
Contributor Author

router/router_test.go:81::warning: cyclomatic complexity 20 of function TestParse() is high (> 10) (gocyclo)
router/basic.go:151::warning: cyclomatic complexity 17 of function (*Progeny).AddRouter() is high (> 10) (gocyclo)
router/router_test.go:167::warning: cyclomatic complexity 14 of function TestRouter() is high (> 10) (gocyclo)
router/string.go:48::warning: cyclomatic complexity 11 of function (*StringNode).Merge() is high (> 10) (gocyclo)
router/router.go:141::warning: cyclomatic complexity 11 of function SegmentToRouter() is high (> 10) (gocyclo)
router/router.go:235::warning: cyclomatic complexity 11 of function Reorganize() is high (> 10) (gocyclo)
router/basic.go:78:1:warning: comment on exported type CharRouter should be of the form "CharRouter ..." (with optional leading article) (golint)
router/basic.go:150:1:warning: comment on exported method Progeny.AddRouter should be of the form "AddRouter ..." (golint)
router/router.go:34:6:warning: type name will be used as router.RouterKind by other packages, and that stutters; consider calling this Kind (golint)
router/router.go:88:2:warning: comment on exported const FullMatchTarget should be of the form "FullMatchTarget ..." (golint)
router/router.go:91:2:warning: comment on exported const TailMatchTarget should be of the form "TailMatchTarget ..." (golint)
router/router.go:152:10:warning: if block ends with a return statement, so drop this else and outdent its block (golint)
router/router_test.go:220:10:warning: should not use basic type string as key in context.WithValue (golint)
router/router_test.go:232:9:warning: should not use basic type string as key in context.WithValue (golint)
router/router_test.go:244:10:warning: should not use basic type string as key in context.WithValue (golint)

👆 see above

@jimexist
Copy link
Contributor Author

see #29 and #30

@jimexist
Copy link
Contributor Author

also see results directly here

@ddysher
Copy link
Member

ddysher commented Dec 13, 2017

@jimexist is it still a problem now?

@ddysher ddysher added area/test kind/enhancement Categorizes issue or PR as related to enhancement. labels Dec 13, 2017
@jimexist
Copy link
Contributor Author

yes - no update yet @ddysher

@ddysher
Copy link
Member

ddysher commented Dec 20, 2017

ok, can we lower the priority and clean up later?

@kdada kdada mentioned this issue Dec 29, 2017
24 tasks
@kdada kdada added this to the v0.2.0 Alpha milestone Apr 23, 2018
@kdada kdada modified the milestones: v0.2.0 Alpha, Long Term Jun 20, 2018
@caicloud-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

/lifecycle stale

1 similar comment
@caicloud-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@caicloud-bot caicloud-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 17, 2018
@iawia002
Copy link

Migrated to golangci-lint in #287

/close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/test kind/enhancement Categorizes issue or PR as related to enhancement. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

6 participants