

Hound: A service that comments on Ruby style violations in GitHub pull requests - wymy
http://robots.thoughtbot.com/introducing-hound

======
VeejayRampay
Can someone shed some light on the reason why we're still bothering with "line
is too long" in 2014?

I mean I'm not talking 300 characters-long lines here that's ridiculous, but
the idea that a line with 90 characters is "too long" because some arbitrary
limit in the width of certain terminal emulators back in the days was fixed at
whatever number of columns seems really backwards.

So yeah, I'm open too any sane explanation of the why that is actually good
practice beyond what I perceive as severe cargo culting.

~~~
LargeWu
It goes farther back than terminal emulators. the old IBM punchcards
physically only had room for 80 characters.

I'm with you, though. 80 characters is _really_ short, especially if you are
indented more than a few stops. It also discourages descriptive
variable/method names, which harms readability of code far more than slightly
longer lines.

~~~
mjcohen
I like to indent two characters per level of indentation. If the indentation
uses braces, I indent one for the brace and one more for the code.

------
jared314
I have always liked the idea of these bots roaming github, looking for bugs to
fix and code that could be improved. But, it almost always ends up annoying
somehow. Either the change is a false positive, the bot doesn't understand the
project structure, or the bot just spams changes. Software development has too
many unwritten rules and social interactions for a bot to just send PRs and
comments.

Perhaps another type of communication, other than issues, PRs, and comments,
is needed just for bots. I would tolerate my projects being scanned, if I
could separate the human and bot communication streams. (And, block bots when
they don't work as expected.)

~~~
Croaky
You can tune Hound (and Rubocop) to your liking:

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

> the change is a false positive

I've been using Hound on about a dozen projects the last few months and
haven't seen false positives. We built it atop Rubocop, which has been pretty
well-vetted.

> Software development has too many unwritten rules and social interactions
> for a bot

We've limited our guidelines to a subset that should almost always be "no
argument, my bad, fixed in [SHA hash]." However, it comments instead of
failing the build or mechanically changing the code because that the human
should make the final decision about whether to make the change.

------
rubiquity
I love this. On just about any team I have worked on, whenever a fresh PR
comes in everyone goes through it picking out style guide violations. It's
tedious, annoying and sometimes arbitrary if the team doesn't have a solid
style guide in place. Hound will let us get right to reviewing what matters:
the code itself.

Up next: I would love a Unix utility I could filter my uncommitted diff
through and get style guide violations before I even upload to GitHub. Use git
for everything, baby.

~~~
jwinter
This exists and is what Hound is built on. Rubocop runs lint checks against
your Ruby code:
[https://github.com/bbatsov/rubocop/](https://github.com/bbatsov/rubocop/) .
The Emacs integration is great; it highlights failures in place. Hound looks
interesting, but having Emacs/Vim integration gives you a tighter feedback
loop, so you don't have to wait until Pull Request time to discover these
issues.

~~~
salbertson
RuboCop is great, but one benefit of Hound is it only checks code that has
changed. Retroactively enforcing code style is usually a bad idea.

------
mikesilvis
[https://github.com/bbatsov/rubocop](https://github.com/bbatsov/rubocop) FTW.
Integrate it into your test suite and you can see your mistakes before you
push up a change for your team to see.

~~~
huntedsnark
There is also a guard plugin for immediate feedback:
[https://github.com/yujinakayama/guard-
rubocop](https://github.com/yujinakayama/guard-rubocop)

Rubocop can even correct some style errors automatically now!

~~~
llamataboot
Hound is built on Rubocop

------
spajus
Take a look at
[https://github.com/mmozuras/pronto](https://github.com/mmozuras/pronto) \-
does the same, has many adapters.

~~~
russianbandit
Hounds looks easier than pronto. Just turn it on for a repo and it does it's
thing. With pronto looks like I have to configure it, then run commands (could
make it part of default rake task, is suppose).

~~~
spajus
Yes, we run pronto when our Jenkins builds GitHub pull requests, so we get all
those comments along with peer code reviews. And no separate web app is
necessary.

------
caleb_thompson
One thing I've liked with hound is that when it comes up with what I'd
consider a "false positive," such as a line with a url that can't be split, I
can just reply inline to explain why that couldn't change. This pull has a lot
of examples of that:
[https://github.com/thoughtbot/griddler/pull/119](https://github.com/thoughtbot/griddler/pull/119)

~~~
TazeTSchnitzel
It's hilarious how houndci acts like some stubborn human, responding to
complaints with the exact same suggestion.

~~~
caleb_thompson
Yeah, that happens if you force push.

~~~
salbertson
That's not good. I opened an issue on GitHub.

[https://github.com/thoughtbot/hound/issues/182](https://github.com/thoughtbot/hound/issues/182)

------
100k
The marketing site needs some work. There's no details about pricing that I
can find and no information about configuring your own rules (I had to read
the source code to see if that was possible). I am not going to sign up with
GitHub to see either of those things, they need to be public.

~~~
russianbandit
It's a free service right now. We'll be taking all the suggestions and
improving it as we go.

~~~
100k
The announcement blog post implies otherwise:

> It places the focus value not on our super-secret-source-code but on our
> handling of the hosting, _billing_ , and maintenance of that source code.

~~~
salbertson
Sorry if it wasn't clear in the post but we do plan on charging for Hound in
some way.

"We intend to charge in the near future to ensure Hound is sustainable, but
public projects will continue to be free."

~~~
100k
I don't expect this to be free. My point is that pricing should be clearly
stated on the landing page for the product. You should have a pricing link or
header, even if it just says "free for now, we're working on pricing".

~~~
salbertson
Got it, thanks for the input.

------
guptaneil
This is really cool. Sure, similar tools have existed for a while, but Hound
looks far simpler to setup and use than previous tools.

However, it would be nice to have this optionally run on every commit rather
than only on pull requests. For my own personal projects, I obviously don't
submit pull requests to myself, but I would like to have Hound double-check my
code for me.

~~~
dmur
Not sure it should be obvious you don't. Pull requests are especially well-
suited for a team environment, but using PRs in a solo project can still give
a higher level of structure to the progression of your code. Gives you an
opportunity to explain why you're doing what you're doing.

~~~
sanderjd
You can also accomplish this without pull requests by writing good messages in
your merge commits like you would in a pull request description.

------
paultannenbaum
This is great. Is it possible to use this as a rake task? I think it would be
better to have team members run this locally just like they would run a test
suite, make sure everything is up to par, and then open a PR. This would keep
the communication stream in the PR nice and clean, focused only on code
implementation.

~~~
mikesilvis
[https://github.com/bbatsov/rubocop](https://github.com/bbatsov/rubocop)

------
jeez444
This is a great product. I was working on a product when a new developer
joined and started writing Ruby like he was writing in PHP, ignoring all of
the programming language's idioms. What was worse was that with every commit
where his code was "cleaned up", he'd put them back in!

~~~
salbertson
Glad you like it!

------
l_ew_is
Not sure I'd want to give this site Github access:
[http://filippo.io/Heartbleed/#houndci.com](http://filippo.io/Heartbleed/#houndci.com)

~~~
salbertson
Read the FAQ, this is expected when the server has been patched as long as the
site is responding.

~~~
l_ew_is
It was giving me a "houndci.com IS VULNERABLE." 45 mins ago.

[http://l.ew.is/shared/houndci.com_IS_VULNERABLE.png](http://l.ew.is/shared/houndci.com_IS_VULNERABLE.png)

~~~
salbertson
Is that still the case? I'm seeing a timeout when I run the test.

[https://www.dropbox.com/s/txlzh5jzrt30afs/Screenshot%202014-...](https://www.dropbox.com/s/txlzh5jzrt30afs/Screenshot%202014-04-09%2015.13.37.png)

Again, we have reissued our certificates and installed them since the servers
were patched.

------
strzalek
I hate those github bots. Just use rubocop and run it in your CI.

~~~
salbertson
Hound is opt-in, it won't ever add itself to your repo and start commenting.

