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

Using upstream maligned and updating error message #1555

Closed
wants to merge 4 commits into from

Conversation

iwankgb
Copy link
Contributor

@iwankgb iwankgb commented Dec 12, 2020

It seems that we can swap our maligned fork for the upstream version, but messages from upstream are slightly different from those that have been used so far. I'm not sure how big issue it can be and I would like to discuss it.

https://github.com/golangci/maligned/commits/master
https://github.com/mdempsky/maligned/commits/master

@iwankgb iwankgb requested a review from a team December 12, 2020 23:21
@iwankgb iwankgb added the forks We shall not use forks of linters label Dec 12, 2020
@Nivl
Copy link
Member

Nivl commented Dec 13, 2020

The new error message might cause an issue for the people that have set up rules in the config file, but my assumption is that if you have a rule to exclude this message then the whole linter becomes useless. That being said maybe someone can prove me wrong on that. I'm assuming it's also expected to have some messages change when we update a linter since we usually don't own the code and are bound to whatever happens upstream.

The biggest issue is, IMO, the fact that we're fully losing the "suggestion" that we get with -v. Without the suggestion, you know that the struct is not optimized but that's it, it's your job to figure out how to reorder everything to make them fit. With the suggestion, it actually gives you the solution to have a proper memory-aligned struct. There's a PR open to add support for that, but the owner of maligned never merged it and then recently refactored the codebase which added a bunch of breaking changes to the PR.

We gonna need more people to weigh on if we want to merge this PR not. We could also have someone send a new PR to maligned to add support for -v. cc @golangci/team

@ldez ldez added the blocked Need's direct action from maintainer label Jan 7, 2021
@juliaogris juliaogris removed the request for review from a team February 15, 2021 23:18
@iwankgb
Copy link
Contributor Author

iwankgb commented Feb 21, 2021

@golangci/team, can more of your express an opinion?

@bombsimon
Copy link
Member

I don't see any problem changing message. Similar thing happened when we bumped gochecknoglobals f.ex. It's easy to pin a version of golangci-lint, in fact it's probably harder to auto update. As long as peoples CI doesn't break because we make changes I think we should prefer keeping the repo up to date with all linters and dependencies.

If I remember correctly, one of the reasons why golangci-lint doesn't provide much of a public interface to execute the tool from code is to be able to somewhat diverge from semver and be able to update any version of a linter (major, minor or patch) without having to do the same for golangci-lint.

@ldez
Copy link
Member

ldez commented Feb 21, 2021

I shared the opinion of @Nivl about suggestions:

The biggest issue is, IMO, the fact that we're fully losing the "suggestion" that we get with -v. Without the suggestion, you know that the struct is not optimized but that's it, it's your job to figure out how to reorder everything to make them fit. With the suggestion, it actually gives you the solution to have a proper memory-aligned struct. There's a PR open to add support for that, but the owner of maligned never merged it and then recently refactored the codebase which added a bunch of breaking changes to the PR.

@iwankgb iwankgb closed this Feb 22, 2021
@iwankgb
Copy link
Contributor Author

iwankgb commented Feb 22, 2021

There is no consensus therefore it won't be merged.

@Nivl
Copy link
Member

Nivl commented Feb 22, 2021

Note that as of last week, maligned has been deprecated. The recommandation is to switch to https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/fieldalignment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Need's direct action from maintainer forks We shall not use forks of linters
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants