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

megacheck, unused, gosimple had been deprecated in favor of staticcheck #357

Closed
lopezator opened this issue Jan 16, 2019 · 11 comments · Fixed by #4562
Closed

megacheck, unused, gosimple had been deprecated in favor of staticcheck #357

lopezator opened this issue Jan 16, 2019 · 11 comments · Fixed by #4562
Labels
dependencies Relates to an upstream dependency topic: cleanup Related to code, process, or doc cleanup

Comments

@lopezator
Copy link
Member

lopezator commented Jan 16, 2019

Megacheck, unused and gosimple had been deprecated in favor of staticcheck.

https://github.com/dominikh/go-tools/tree/master/cmd/gosimple
https://github.com/dominikh/go-tools/tree/master/cmd/megacheck
https://github.com/dominikh/go-tools/tree/master/cmd/unused

So I think it makes sense that we remove them in golangci-lint and go through staticcheck implementation to update it and check if we need to add or fix something.

CC/ @jirfag

@lopezator
Copy link
Member Author

Related issues:

#314
#355

@jirfag
Copy link
Member

jirfag commented Jan 20, 2019

@lopezator thank you, I know and I've already updated megacheck code recently to the latest version.

But I decided to not replace gosimple, staticcheck, unused and megacheck by staticcheck because this renaming wasn't backward compatible. Some users enabled only staticcheck in config and don't want gosimple to be enabled in a new release.

Maybe you have ideas how to rename it without breaking configuration of existing users?

@lopezator
Copy link
Member Author

lopezator commented Jan 21, 2019

The easy path is to follow semver rules (see point 2) MAJOR version when you make incompatible API changes.

And go for a new major version v2.0.0. That doesn't mean we have to stop new features (or patch fixes) in v1, but it will freeze at one point.

There two different strategies to follow here:

  1. Be as close as posible as the individual check usage, but grouped here (naming, flags, configuration...).
  2. Diverge in some points of add/remove specific things in order to provide backwards compatibility to users, but it's a tricky path to follow as in some point in time we will have to come back, and then, the jump will have to be higher.

Both have it's pros and cons.

Posible middle solutions I can think of are hard to write and maintain:

  1. Go for a version property in the yaml (as docker-compose does):

https://docs.docker.com/compose/compose-file/compose-versioning/

  1. Detect automatically divergences on config on first run (maybe easier, but would require a lot of work also).

@marctc

This comment was marked as off-topic.

@lopezator
Copy link
Member Author

lopezator commented Aug 7, 2019

Hello @jirfag any news on this?

What would be the plan on this? just updating staticcheck to latest version?

In that case I think we should add a note that the recommended usage from now is staticcheck and that megacheck, gosimple, unused are deprecated although you keep them also for compatibility reasons.

Related:

https://twitter.com/dominikhonnef/status/1155646606940803072

Would yo accept a PR updating the statickcheck to latest 2019.2.2?

https://github.com/dominikh/go-tools/releases

Thanks.

@lopezator
Copy link
Member Author

An idea to do not break backwards compatibility and do not deprecate older tools might be adding a property to staticcheck config, called, for example:

gte_2019_1: true

This flag (false by default) would enable the possibility to use the new staticcheck (gosimple, megacheck, unused are now called simply staticcheck from this version).

https://staticcheck.io/changes/2019.1

@lopezator
Copy link
Member Author

Now that you are back @jirfag, I am still interested on moving this forward, and could take this.

Just need some feedback on the proposed design.

@lopezator lopezator added this to the v2.0.0 milestone Sep 24, 2019
@tpounds tpounds added the topic: cleanup Related to code, process, or doc cleanup label Oct 5, 2019
@tpounds tpounds added the dependencies Relates to an upstream dependency label Dec 30, 2019
@glerchundi
Copy link

Is this issue already solved? It seems like staticcheck is already available. Just double-checking...

@ldez
Copy link
Member

ldez commented May 16, 2021

staticcheck is up-to-date in golangci-lint, and we update the dependency automatically via dependabot.

The issue is still opened because the merge of the 4 linters is breaking, so it will be done in the next major version (v2).

@ldez ldez changed the title megacheck, unused, gosimple had been deprected in favor of staticcheck megacheck, unused, gosimple had been deprecated in favor of staticcheck May 17, 2021
@stale
Copy link

stale bot commented Jul 10, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale No recent correspondence or work activity label Jul 10, 2022
@ldez ldez added pinned and removed stale No recent correspondence or work activity labels Jul 10, 2022
@mvrahden
Copy link

Hi, is this still going to be taken care of? What is the ETA of v2?

mihaitodor added a commit to redpanda-data/connect that referenced this issue Dec 9, 2023
I noticed this by running [staticcheck](https://staticcheck.dev).
Unfortunately, golangci-lint is still using a deprecated version
of this linter. See [here](golangci/golangci-lint#853)
and [here](golangci/golangci-lint#357).

Signed-off-by: Mihai Todor <[email protected]>
harshit-sp pushed a commit to harshit-sp/benthos that referenced this issue Feb 4, 2024
I noticed this by running [staticcheck](https://staticcheck.dev).
Unfortunately, golangci-lint is still using a deprecated version
of this linter. See [here](golangci/golangci-lint#853)
and [here](golangci/golangci-lint#357).

Signed-off-by: Mihai Todor <[email protected]>
Signed-off-by: harshit-sp <[email protected]>
@ldez ldez removed the pinned label Mar 21, 2024
@ldez ldez removed this from the v2.0 milestone Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Relates to an upstream dependency topic: cleanup Related to code, process, or doc cleanup
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants