coala / coala-bears

Bears for coala
https://coala.io/
GNU Affero General Public License v3.0
295 stars 580 forks source link

Generate go dependencies #2481

Open jayvdb opened 6 years ago

jayvdb commented 6 years ago

.ci/generate_bear_requirements.py generates bear-requirements.yaml which moban uses to generate package.json, bear-requirements.txt and Gemfile.

bear-requirements.yaml doesnt include go dependencies yet. This is the most important part of this issue.

The same process could also generate Go requirements in an format usable by a go dependency management tool, using jinja2 templates.

e.g. https://github.com/golang/dep which uses Gopkg.toml

jayvdb commented 5 years ago

Our go setup has changed a bit since this issue was first created.

All the go bears are installed in CI using gometalinter 's installer, which manages the versions of each linter.

We can add those versions to our bears .py files, but that will get out of date quickly.

I suggest this issue avoids the versions to begin with.

It can still add Go bears to bear-requirements.yaml , even without a version. That would be a minimal solution. Given the importance of this issue, because go is our largest language not yet in bear-requirements.yaml , the minimal solution is enough to be merged.

If it is possible to generate Gopkg.toml (or similar) without versions, that would be great.

Or it could obtain the version dynamically from gometalinter , and put them into the yaml only, but this will mean frequent CI failures whenever gometalinter updates a version.