-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
A better way to install and run golangci-lint in a single command #1657
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
Comments
Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors. |
This reminds me of |
Yes, I borrowed some ideas from it. |
What about installing
This way is (I believe) truly cross-platform and can be used e.g. like this: https://github.com/pellared/goyek-demo/blob/e51b9211be1155cbf1cca40d8f1eb392e6dda592/build/build.go#L41-L46 It does not have some of the disadvantages that ReferencesFrom: https://golang.org/ref/mod
More: |
@pellared The problem is to build the I tested with bare docker container, it will be significantly slower to use With $ docker run --rm -it golang bash
$ time go install github.com/golangci/golangci-lint/cmd/[email protected]
real 0m46.282s With my solution $ docker run --rm -it golang bash
$ time go install github.com/ysmood/golangci-lint@latest
real 0m7.769s
$ time golangci-lint
real 0m1.330s As you can see the |
@ysmood It is cool. Personally, I would add an option to add a checksum validation for additional integrity checking. Supply chain attacks are becoming more and more frequent. |
@pellared Good idea, please feel free to make a PR. Currently, this project is just a proof of concept, welcomes all kinds of ideas. |
The current recommended approach is also documenting the tool used in a file called tools.go. https://github.com/go-modules-by-example/index/blob/master/010_tools/README.md |
@photoszzt I think it has the same issue because internally |
Currently, the major way to install
golangci-lint
requires extra dependencies like sh, curl, tar, etc. It's not cross-platform and not user friendly to maintain.Since any user use this tool will have golang installed, why not just use golang to do the automation job? So that there will be zero dependencies and assumptions for users' environment.
Here's my demo solution project: https://github.com/ysmood/golangci-lint
The demo project has zero dependencies and fast to download, build, and run.
How about we fork the project to a namespace like
golangci/golangci-linter
and document it hereSo that we don't have to maintain Brew or MacPorts binary anymore.
The text was updated successfully, but these errors were encountered: