-
Notifications
You must be signed in to change notification settings - Fork 3
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
golangci: try to set up golangci #43
base: main
Are you sure you want to change the base?
Conversation
8fbbd9c
to
d59304c
Compare
The ebpf libraries are not helping at all. Fix alegrey91#28
d59304c
to
b1716de
Compare
@alegrey91 Please review I suggest you to consider merging it, and fixing the issues one by one I set up the test as non-blocking, I could separate the golangci-lint in a dedidated jobs, just tell me if you want to launch golangci-lint locally please use the following command golangci-lint run internal/analyzer internal/archiver internal/elfreader internal/embeddable internal/executor internal/metadata harpoon/internal/privileged internal/seccomputils internal/w
riter |
This solution doesn't work well. We can't remember to add any new packages to the list of the lint. |
Additionally, I would keep this job in a dedicated pipeline for linting. |
I know it's a pain. I wanted to proof it was possible. We will have to look at GitHub action on how to pass the list of package. There is unfortunately no way to ask a linter to ignore a file. It reads everything, and any typecheck issue are breaking everything. It's what is happening with this file depending on the external lib. There might be a way to refactor, by using distinct modules in the code, but it would need a huge rewrite. |
Noted. I will split it when I have a chance to look at a way to set a variable by calling a shell command or script |
What about something like this? |
I don't expect this to work, but they are among the idea I plan to try |
Here is it what we could use to store the list of packages by using the grep command you had thomast1906/thomasthorntoncloud-examples#92 Another solution could be to split the code that can be tested in a package in internal and leave the one that depends on the external lib in another. Something like: cmd This way you only test and run golangci-lint-config-examples on internal/ok |
what if we use something like instead? skip-dirs:
- internal/ebpf
- ebpf/ This would be easier |
It cannot work unfortunately. Longtime debated in golangci-lint ecosystem. golangci-lint has to parse everything, but if it finds code that cannot be compiled. It would fail. So using skipdir cannot work. It's worth trying, but I'm pretty sure it won't work the way we need. Note: I'm busy with family this weekend, I cannot try it. |
The ebpf libraries are not helping at all.