mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00

Here we add file `.golangci.yaml`, to have a common configuration for static analysis. If you use the following IDEs/editors, they will read the file: - `vim` with vim-go. - VSCode. The initial configuration file is based on Kubernetes' HEAD. We removed a custom kubernetes-linter for custom kubernetes-logging. We also changed to Golang version 1.17 (etcd's current target Golang version) from 1.18. Also, we added a new target to `Makefile`: `lint`. NOTE that auto-fixing should be part of a later commit, once we are all happy with how the configuration file is working for us. As expected, this change fixes two issues found by this `.golangci.yaml` in file `contrib/lock/client/client.go`: - Dead code, removed. - Innefective assignment, removed. Finally, we are updating `CONTRIBUTING.md` to mention `golangci-lint`. We will add a GitHub-action to run `golangci-lint` in a future change. Local testing done: - `make build`. - `make test`. Both are happy. This is the initial step to fix https://github.com/etcd-io/etcd/issues/14164. Signed-off-by: Ramsés Morales <ramses@gmail.com>