golangci / golangci-lint

Fast linters runner for Go
https://golangci-lint.run
GNU General Public License v3.0
15.8k stars 1.39k forks source link

add linter checklock from gvisor #2479

Open jerome-laforge opened 2 years ago

jerome-laforge commented 2 years ago

Your feature request related to a problem? Please describe.

According to you, is it possible to add checklock from gvisor https://github.com/google/gvisor/tree/master/tools/checklocks in golangci-lint?

Describe the solution you'd like.

n/a

Describe alternatives you've considered.

n/a

Additional context.

https://github.com/google/gvisor/tree/master/tools/checklocks

ldez commented 2 years ago

Hello,

The main problem with this linter is the fact that is not a go module by itself. For me, it's not a good idea to link the dependencies of gvisor with golangci-lint.

jerome-laforge commented 2 years ago

As prerequisite, do you mean that, gvisor has to make the checklock code as external repository?

ldez commented 2 years ago

After a quick review of the linter (I haven't tested the linter itself yet), what I can say is that the prerequisite for this linter is to be a module. There is a different way to do this: add a go.mod to the folder or externalize the code to a repo.