Dgraph lint an alternative to houndci for Go

We have been using houndci for a bit and it has been working fine for us. Though the fact that it comments on auto-generated files and there is no way to get it to ignore those is very irritating.

Thanks to learning Fridays, I spent some time last Friday and today to build a simple Go program which can monitor your PRs, run them through golint and comment on your PR. Pretty much what hound does, though now we have the ability to ignore files with

  • An extension
  • In a folder
  • A particular file

I also noticed that on multiple iteration in a PR hound comments on the same line again even though it wasn’t changed in that particular iteration. This shouldn’t happen with Dgraph lint because we only look the changed lines in an iteration.

I also plan to add support for other linters like go vet and errcheck for now. I will run this in debug (comments are not published to Github but just printed to console) mode for a week, if it works fine then we can replace hound with this.

I think the only disadvantage of this is that we and anyone who uses it has to host it themselves whereas hound is easier to setup because it automates the access token generation process using OAuth2 and persists those. Maybe I can try that later.

Looking forward to feedback from you guys. :slight_smile: https://github.com/dgraph-io/lint


So, is it running as a server? How do we test this? By running it manually over the PRs?

Given that we already ignore most of what HoundCI does, we could just turn this on right away, and turn off HoundCI.

Also, the other annoyance with HoundCI is that even if you address those comments, HoundCI doesn’t acknowledge them. Is there a way you could deal with that? By either creating them as yourself, and then manually ACKing them; or having your bot ACK it.

I will run it as a server. Yesterday I spent some time integrating OAuth2, so that permissions can be granted using the Github OAuth Web UI and doesn’t have to be done manually. So once I deploy it, I will ask you to authorize the application.

That would be tricky because AFAIK acknowledging is a Reviewable concept and they don’t have an API so we can’t really do much there.

I suppose if you post the comments as yourself, then you can enforce them and ACK them for all the PRs. That could work well, having you do the lint enforcement.

1 Like