Hacker News new | ask | show | jobs
by rubiquity 4449 days ago
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.

2 comments

This exists and is what Hound is built on. Rubocop runs lint checks against your Ruby code: 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.
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.
You can also use linting tools as a build validation step (ours are invoked via things like `make myapp.pep8test`). These can also then be invoked yourself before making a commit. As jwinter says, this really tightens the loop when fixing trivial errors.

Almost all of the tools are very configurable in terms of which warnings/errors you want to ignore (e.g., let our max line length be 120 instead of 80), and give pretty good feedback (line numbers, exact error).

Another great benefit is that you have a neutral arbiter of what's the style for your codebase, which helps avoid ruffled feathers.

I figured such a tool must exist. Thank you for helping me remain lazy. I agree about having the tighter feedback loop.

I'm hoping to create a git filter that stops the commit from happening if there are style guide violations.

> filter my uncommitted diff through and get style guide violations before I even upload to GitHub

You should be able to do this using a pre-commit hook.