Rubocop is an absolute pleasure to work with, but it also helps that the ruby community seems to have a more widely-agreed upon style guide than other communities (Javascript comes to mind). There are similar tools for Javascript, and I imagine many of them are configurable as well to cover most use cases. But with the diversity of Javascript style guides and the lack of cohesiveness in the js community, it seems unlikely that many of these would be as useful as rubocop 'out-of-the-box'.<p>It would be <i>amazing</i> if a similar static code analysis tool existed with settings to conform to the most popular javascript style guides: npm, idiomatic, jQuery, etc. But even within these style guides there is a lot of 'undefined behavior', or situations that aren't explicitly described in the guides.
I'm a casual ruby programmer (I only use it to write "powerful bash scripts") and have been using rubocop with vim/syntastic.<p>The attention to detail is incredible, which I'm not sure if I like or not, since it usually feels like I have someone nitpicking about the style of my quick scripts.<p>I've been learning a lot about ruby standards though.
Is "static code analyzer" the new spelling for lint(1)?<p><a href="https://www.freebsd.org/cgi/man.cgi?query=lint&sektion=1" rel="nofollow">https://www.freebsd.org/cgi/man.cgi?query=lint&sektion=1</a><p>I've always been a big fan of code linters. They may not be perfect, but any bug you can catch at compile-time (or earlier) could be saving you hours of trying to track down runtime problems. In languages with a managed runtime such as ruby where you don't really have the same kind of compile-time checking, a good linter is even more important.<p>It was a pretty crazy day when I first found RuboCop. I immediately used it on the large amount of ruby I've written over the last ~decade.
Is there a way to have RuboCop automatically clean up things it detects? Obviously I would run this one file at a time, and git diff it before committing it.
At GitLab we recently implemented this in our tests. After this all the reminders and comments about style are no longer needed. You just need to have green tests as you always should. We think having it in CI is a much better experience than a HoundCI that makes line comments in the merge request, that gets quite noisy for people following the MR.
I highly recommend it's use with pronto. We run Rubocop, Rails Best Practice and Brakeman against every commit by calling pronto from CircleCI.<p><a href="https://github.com/mmozuras/pronto" rel="nofollow">https://github.com/mmozuras/pronto</a>
Absolutely amazing tool, always part of my CI build for Ruby projects.<p>Even though in a lot of cases I don't care as much about the style used per se, it's a treat to have a consistent coding style in projects with multiple team members.
Integrate with GitHub review comment not only RuboCop but also eslint, jscs, and any lint. <a href="https://github.com/packsaddle/ruby-saddler" rel="nofollow">https://github.com/packsaddle/ruby-saddler</a>
RuboCop is amazing. I use it in Sublime via <a href="https://github.com/pderichs/sublime_rubocop" rel="nofollow">https://github.com/pderichs/sublime_rubocop</a>
I love how it integrates with text editors (textmate, atom) so well.
There's no need to wait for your CI to tell you you're doing something wrong.
RuboCop's author here. If I knew someone would ever link to the homepage I would have put some useful info in it. :-)<p>Thanks for the kind words!<p>P.S. There's a lot more info here <a href="https://github.com/bbatsov/rubocop" rel="nofollow">https://github.com/bbatsov/rubocop</a>