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

Make some linters really happy #22979

Closed
8 tasks done
zimulala opened this issue Feb 26, 2021 · 19 comments · Fixed by #22990 or #22993
Closed
8 tasks done

Make some linters really happy #22979

zimulala opened this issue Feb 26, 2021 · 19 comments · Fixed by #22990 or #22993
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/enhancement The issue or PR belongs to an enhancement.

Comments

@zimulala
Copy link
Contributor

zimulala commented Feb 26, 2021

Description

Currently, we use "golangci-lint" to execute some linters, but due to some reasons, the entire project code may not really pass some necessary linters.
This issue is for everyone to work together to pass some necessary linters for this project. The specific parameters that need to be supported are shown in the task list below.

Related Information

Task List

  • --enable=deadcode
  • --enable=errcheck
  • --enable=gosimple
  • --enable=staticcheck
  • --enable=typecheck
  • --enable=unused
  • --enable=varcheck
  • --enable=structcheck

We can cooperate in handling this issue by picking up the corresponding parameters.

@zimulala zimulala added type/enhancement The issue or PR belongs to an enhancement. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Feb 26, 2021
@zimulala
Copy link
Contributor Author

Relate to #22754

@Tjianke
Copy link
Contributor

Tjianke commented Feb 26, 2021

I would like to try on errcheck part.

@disksing
Copy link
Contributor

I'll take structcheck.

@Willendless
Copy link
Contributor

Willendless commented Feb 27, 2021

I'll try --enable=varcheck.

@tisonkun
Copy link
Contributor

I would like to try on errcheck part.

@Tjianke How is it going? I'll start the development this weekend if no activity yet.

@Tjianke
Copy link
Contributor

Tjianke commented Apr 22, 2021

I would like to try on errcheck part.

@Tjianke How is it going? I'll start the development this weekend if no activity yet.

Merged PRs on most packages, 3 PRs still waiting for review.

@tisonkun
Copy link
Contributor

Thanks! I can see

#22994
#23002
#23001

@tisonkun
Copy link
Contributor

@zimulala @disksing unused is enabled by the whole #23013 . Please update the description of this issue.

@disksing
Copy link
Contributor

@tisonkun cool, thanks!

@tisonkun
Copy link
Contributor

gosimple is enabled by #24617

@dveeden
Copy link
Contributor

dveeden commented Aug 2, 2021

The tasks in the description that are still open are the onces for staticcheck and errcheck. However looking at the Makefile it looks like we already run those outside of golangci-lint. And there is tools/check/errcheck_excludes.txt and staticcheck.conf to configure those.

So what's left to do here? Change the Makefile to run these under golangci-lint? Remove excludes from the configs? Include more tests? golangci-lint also has many more tests that are not enabled by default.

@disksing
Copy link
Contributor

disksing commented Aug 4, 2021

I think it would be a good idea to use golangci-lint to run all tests. By running all linters from a single entry point, we can more easily run all linters from a single command, and also better align parameters such as timeout.

@xxchan
Copy link
Contributor

xxchan commented Aug 9, 2021

Is this issue done?

@dveeden
Copy link
Contributor

dveeden commented Aug 9, 2021

Is this issue done?

As far as I know everything is done

@disksing
Copy link
Contributor

disksing commented Aug 9, 2021

All done. Thank you to all who participated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants