Recently we’ve been using linters to improve the code quality of the Juju codebase, with the employment of the following:
- gofmt - ensures that the formatting rules of every go file is the same
- goimports - the imports of a gofile are correct
- misspell - removes some very basic spelling errors
- unconvert - removes unnecessary type conversions
- govet - reports suspicious constructs
Recently we used gometalinter to solve these requirements, but unfortunately gometalinter has been deprecated and is no longer being maintained. It recommends that golangci-lint is used as a successor and I’ve just converted the Juju codebase over to this new linter.
If anything is wrong or isn’t quite working as expected, then please let me know so I can fix it.