Proposal: split & containerize hack/validate

My proposal is to split https://github.com/moby/moby/tree/master/hack/validate into a new repo, and containerize it so that the scripts can be reused across all the relevant repos.

e.g.
$ docker run -v ~/gopath:/go moby/validator:latest github.com/moby/go-foo github.com/fookit/fookit

2 Likes

Discussed on slack

  • Rather, deprecate hack/validate
  • Use gometalinter
  • Use vndr --check (unimplemented yet)

So, my next proposal is to

  • Close https://github.com/LK4D4/vndr/pull/45
  • Remove moby/moby/hack/validate (directory), and create moby/moby/validate.sh (single script file).
    – go-get gometalinter and vndr if not installed
    – run gometalinter with our own custom config
    – check manually modified files by running git status ..., rather than relying on vndr

validate.sh should not depend on another file, and should be ready for curl | bash.

Moby-related projects should contain curl validate.sh | bash in their CI configuration file (e.g. .travis.yml)

cc @dnephin @vieux

I don’t think a single validate.sh is going to work for all repos. Each repo is going to have slightly different validations, and different gometalinter thresholds.

At the very least the gometalinter.json has to be in the repo itself not bundled with the other validation.

Things like checking generated code, and config files are very specific to a repo.

I think an image or package that handles all the vendor validation sounds good. It can be a self contained unit that is used the same way in every repo.

I don’t really agree that vndr is the wrong place for this check. If LK4D4 doesn’t want to support it that’s fine. Maybe we can fork and add the check, or create a go tool that imports vndr and does both?

gometalinter is already a well defined tool, we just add a config from the repo.
With a vendor checking tool we should be set for most repos. We can add other custom stuff as necessary in the repo that uses it.

I think is is ok to close this “issue”.
(No “close this issue” button?) (EDIT: I found the “solve” button)