
Linthub: Static code analysis for GitHub pull requests - nl5874
https://linthub.io/
======
remi
Instead of using a service like this one (or Hound) that comments directly on
pull requests, we chose to integrate the same tools in our build process with
Phare ([https://github.com/mirego/phare](https://github.com/mirego/phare)), a
command-line tool we built which runs Rubocop, JSHint, JSCS, etc. and exits
with a global status.

If the code has coding style violations, the build breaks. Exactly like it
would if we pushed a failing test.

Personally, I’m not a fan of the noise generated by comments about coding
style on pull requests.

~~~
hk__2
I guess the advantage of Linthub over Phare is that it can run on pull
requests made by external contributors.

~~~
remi
Actually, it does in a certain way. Travis runs builds (tests + Phare) for all
pull requests (eg. [https://travis-
ci.org/mirego/encore/pull_requests](https://travis-
ci.org/mirego/encore/pull_requests)) so we know if pull requests made by
external contributors "break the build".

~~~
nl5874
Yes, true, but only if it breaks. This enforces common code quality issues, so
it will run side-to-side with travis.

~~~
ayrx
In all my projects (and the projects I contribute to), style issues are a
build-breaking defect.

In Python this usually means running flake8 as a Travis job.

------
zidar
This looks pretty awesome and will just get better as more languages get
supported. But, it comments on commits, not on the diff in the PR. I think
commeting on the diff looks nicer (you see code snippet with the comment) and
in my opinion it's also easyer to find all the comments that way. Instead of
clicking the commit hash on the commen each time.

~~~
nl5874
Thanks! Will check and handle this.

~~~
nl5887
The release with commenting on pull requests is active now. Linthubot will
comment on the pull request itself instead of the commit.

------
konradko
There is a free open source alternative written in Python:
[https://github.com/justinabrahms/imhotep](https://github.com/justinabrahms/imhotep)

It runs on the commit diff with a specified linting tool (used it with pep8
and jshint), it is also fairly easy to add new linters.

Here's a fork that works nicely with Travis:
[https://github.com/glowdigitalmedia/imhotep](https://github.com/glowdigitalmedia/imhotep)

------
jbrooksuk
So this is like Hound[1]? - I am (kinda) building something for PHP, Anorak[2]
which uses something else I built.

What's your plan on this? I'd like to use it for our private repositories.

Edit: My web hooks are returning errors. I'll submit some feedback.

[1] [https://houndci.com](https://houndci.com)

[2] [https://github.com/jbrooksuk/anorak](https://github.com/jbrooksuk/anorak)

~~~
nl5874
It seems comparable, though we are supporting different languages. Plans are
to support a lot more languages, and support private repos also. (Actually
they are already supported, but linthubot needs to have read only access to
the repository). All feedback is welcome.

~~~
jbrooksuk
Thanks! Are you planning on charging for this? I have an error, can I email
you guys?

Edit: Nevermind, I found the support form.

~~~
nl5874
Currently no plans for charging. If we'll change these plans, existing
repositories will stay free. Send an email to support@linthub.io for the
error, and we'll check it immediatly.

------
untitaker_
Similar services:

[https://houndci.com/](https://houndci.com/) [http://scrutinizer-
ci.com/](http://scrutinizer-ci.com/)
[http://landscape.io/](http://landscape.io/)
[http://codeclimate.com/](http://codeclimate.com/)

~~~
joncp
Does anyone know how these services stack up against each other? I use
CodeClimate and it rocks, but I'm curious about how the others work.

~~~
carlio
I may be biased as I made Landscape.io, but it rocks too!

------
dominotw
Are there any opensource tools that do the same thing( like reek for ruby) ?

I would like to use something like this at work but we don't host code on
github.

~~~
russianbandit
Try RuboCop for ruby.

------
lsaferite
Does github not have granular enough permissions to allo commenting on pull
requests without granting write access to a repo?

~~~
nl5887
Yeah, true. We've tightened the scope, read/write is not necessary any longer.
Only for private repo's, the linthubot user needs to be added to the repo with
read access.

------
jchomali
This look awesome! But there are a lot of similar services such as
codeclimate.

