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

Run golint and deadcode and consider cleaning #91

Closed
kortschak opened this issue Jul 31, 2014 · 6 comments
Closed

Run golint and deadcode and consider cleaning #91

kortschak opened this issue Jul 31, 2014 · 6 comments
Labels

Comments

@kortschak
Copy link
Contributor

golint . | wc -l prints 534. 191 of these are not due to lack of documentation and can be cleaned relatively easily. The rest probably deserves a "needs documentation" issue.

find -type d -exec deadcode '{}' \; identifies two non-codegen instances of unused code. These are also easily cleanable (one - cpuprofile is the subject of a PR, the other is graph/iterator/fixed_iterator.go:53:1: newFixed).

@robertmeta
Copy link
Contributor

Yep -- we are planning to do a gometalinter over the whole codebase in the near future and chase down all the issues.

@robertmeta robertmeta added this to the Soon! milestone Jul 27, 2016
@dennwc dennwc removed this from the Soon! milestone Sep 17, 2016
@iddan
Copy link
Collaborator

iddan commented Sep 22, 2019

Now there are only documentation warnings:

imports.go:5:2: a blank import should be only in a main or test package, or have a comment justifying it
imports.go:8:2: a blank import should be only in a main or test package, or have a comment justifying it
imports.go:12:2: exported var StartMorphism should have comment or be unexported
imports.go:18:6: exported type Iterator should have comment or be unexported
imports.go:19:6: exported type QuadStore should have comment or be unexported
imports.go:20:6: exported type QuadWriter should have comment or be unexported
imports.go:22:6: exported type Path should have comment or be unexported
imports.go:24:6: exported type Handle should have comment or be unexported
imports.go:29:1: exported method Handle.Close should have comment or be unexported
imports.go:35:1: exported function Triple should have comment or be unexported
imports.go:39:1: exported function Quad should have comment or be unexported
imports.go:43:1: exported function NewGraph should have comment or be unexported
imports.go:55:1: exported function NewMemoryGraph should have comment or be unexported

Once they will be resolved we can CI on golint to make sure we don't introduce new errors.

@iddan
Copy link
Collaborator

iddan commented Oct 14, 2019

Actually, I ran only on the top level

@iddan
Copy link
Collaborator

iddan commented Apr 30, 2020

Lint should be done by bash lint.sh as it has defined ignored patterns.

@iddan iddan closed this as completed Apr 30, 2020
@kortschak
Copy link
Contributor Author

I'd suggest a stronger approach to linting that what you have there. The golangci-lint metalinter does a good job and allows exclusions. The SAAS that they used to provide doesn't exist anymore, but it can be replicated in your CI. We do it like so: https://github.com/gonum/gonum/blob/master/.travis/script.d/check-lint.sh

@iddan
Copy link
Collaborator

iddan commented Apr 30, 2020

This looks really cool. If you'd like to integrate this approach it would be very welcome.

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

No branches or pull requests

5 participants