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

Any interest in golangci-lint ? #264

Open
ccoVeille opened this issue Dec 6, 2024 · 5 comments
Open

Any interest in golangci-lint ? #264

ccoVeille opened this issue Dec 6, 2024 · 5 comments
Labels
Question Indicates that an issue, pull request, or discussion needs more information

Comments

@ccoVeille
Copy link
Contributor

Are you interested in adding golangci-lint to your project and CI ?

https://github.com/golangci/golangci-lint

I could help.

@ccoVeille ccoVeille added the Question Indicates that an issue, pull request, or discussion needs more information label Dec 6, 2024
@ccoVeille
Copy link
Contributor Author

A very basic set of rules (such as these https://github.com/ccoVeille/golangci-lint-config-examples/tree/main/03-safe) detected

24 issues:

  • dupword: 1
  • errcheck: 9
  • gci: 3
  • gosimple: 3
  • govet: 1
  • revive: 3
  • staticcheck: 2
  • unused: 2

If I go further with a lot of linters

472 issues:

  • dupword: 1
  • errcheck: 44
  • gci: 10
  • gocritic: 4
  • gosec: 1
  • gosimple: 18
  • govet: 1
  • perfsprint: 6
  • revive: 215
  • staticcheck: 2
  • testifylint: 124
  • unused: 2
  • usestdlibvars: 44

I think you have room for improvements, and I could help

@gouguoyin
Copy link
Collaborator

If possible, thank you very much.

Are you interested in adding golangci-lint to your project and CI ?

https://github.com/golangci/golangci-lint

I could help.

@ccoVeille
Copy link
Contributor Author

sure

I would like to know what you guys prefer:

  • activate golangci-lint in the CI now, but non-blocking
  • activate golangci-lint in the CI now, but non-blocking, limited to code changed only
  • activate golangci-lint in the CI now, blocking on new code, but non blocking for all code base.

The long term target is of course, blocking on all code base

We can start with a periodic task run that will report things.

All these depends on the way golangci-lint reports will be welcomed by the maintainers.

So tell me, of course, I can set it up the way I would like to, but then maintainers and contributions could become temporarily more difficult

Also, there are many things to fix. I could fix them via PR, but I think it would be better if everyone could ramp up in writing better code.

My motto is somehow: Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.

gouguoyin added a commit that referenced this issue Dec 10, 2024
204 issues:
* dupword: 1
* errcheck: 44
* gci: 10
* gosimple: 17
* govet: 1
* revive: 3
* staticcheck: 2
* testifylint: 124
* unused: 2

This is the first iteration of #264 

It can be merged it won't cause problem

You can launch golangci-lint locally and start fixing the issues one by
one

```console
$ golangci-lint run
```
@ccoVeille
Copy link
Contributor Author

What are the next steps then?

I saw you activated it through the CI, the rolled back.

@gouguoyin
Copy link
Collaborator

gouguoyin commented Dec 11, 2024

Rollback is because I found that the compilation did not pass.

@gouguoyin gouguoyin reopened this Dec 11, 2024
gouguoyin added a commit that referenced this issue Dec 12, 2024
This PR fixes a few problems reported by `golangcgi-lint`.
This PR contributes to #264.
gouguoyin added a commit that referenced this issue Dec 13, 2024
This PR fixes issues report from
[testifylint](https://github.com/Antonboom/testifylint).
This PR contributes to #264.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Indicates that an issue, pull request, or discussion needs more information
Projects
None yet
Development

No branches or pull requests

2 participants