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

tools: Add a linter to check for struct fields that aren't used anywhere in the project #1408

Closed
ValarDragon opened this issue Jun 27, 2018 · 12 comments

Comments

@ValarDragon
Copy link
Contributor

Struct check does this, but at the module level. We may need to fork this to get it to do what we want, if there is not already another tool for this.

@zramsay
Copy link
Contributor

zramsay commented Aug 27, 2018

handled in #1417

@zramsay zramsay closed this as completed Aug 27, 2018
@ValarDragon
Copy link
Contributor Author

This hasn't been handled, #1417 didn't include anything which checks that every field in a struct is used somewhere.

@rigelrozanski
Copy link
Contributor

we really need this 100% - would have already saved time, probably other bugs are currently hiding just waiting to be found by this kind of a tool - changed to prelaunch

@ValarDragon
Copy link
Contributor Author

Fixing this probably means forking StructCheck (I haven't found another linter that does this), not sure if thats worth the prelaunch time investment?

@alexanderbez
Copy link
Contributor

@ValarDragon do we need to fork in order to handle embedded structures?

@ValarDragon
Copy link
Contributor Author

Not sure what you mean by embedded structures, I believe it does handle that, it just searches for usage per package, not per repository.

@alexanderbez
Copy link
Contributor

The readme states thats the only thing it doesn't handle. I guess my real question is, why do we need to fork this?

@rigelrozanski
Copy link
Contributor

looking at the codebase it's pretty clean - could probably fork and add repo wide search easily. https://github.com/opennota/check/blob/master/cmd/structcheck/structcheck.go

but also to @alexanderbez 's point though structcheck does not handle embedded structs:
(https://github.com/opennota/check#known-limitations)

@ValarDragon
Copy link
Contributor Author

Why don't we add a new tag for "last things to add during prelaunch phase", I'm cool with this being done then, if we have time.

@zramsay
Copy link
Contributor

zramsay commented Sep 8, 2018

can we consolidate with #1417?

@rigelrozanski
Copy link
Contributor

rigelrozanski commented Sep 8, 2018

We should probably keep the more detailed issues. I think 1417 should get closed by now, see me comment there. This issue is still very much a problem until we integrate in a linter to solve it

@fedekunze
Copy link
Collaborator

fedekunze commented Jun 28, 2019

closed via #4606

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

No branches or pull requests

6 participants