Live data from Hacker News

RuboCop – A Ruby static code analyzer

batsov.com

31–39 of 39 posts

Re: RuboCop – A Ruby static code analyzer

#33
post #22

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.

Do you have some code to make it a spec by chance? I've been thinking about doing that.

Re: RuboCop – A Ruby static code analyzer

#34
post #33
post #22

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.

Do you have some code to make it a spec by chance? I've been thinking about doing that.

A link to the settings we use is here https://gitlab.com/gitlab-org/gitlab-ce/blob/master/.rubocop... it is pretty loose since we recently implemented it and didn't want to have to fix 1600 files :)

Re: RuboCop – A Ruby static code analyzer

#36
Is "static code analyzer" the new spelling for lint(1)?

https://www.freebsd.org/cgi/man.cgi?query=lint&sektion=1

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.

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.

Re: RuboCop – A Ruby static code analyzer

#38

RuboCop's author here. If I knew someone would ever link to the homepage I would have put some useful info in it. :-) Thanks for the kind words! P.S. There's a lot more info here https://github.com/bbatsov/rubocop

bozhidar also is the maintainer of CIDER [1] for Emacs + Clojure. It's the most popular way to use Clojure. [1] https://github.com/clojure-emacs/cider

Guilty as charged. :-)

Re: RuboCop – A Ruby static code analyzer

#39

So what is it, a static code analyzer or a style checker?

AFAIR it's more of a linter ("unreachable code after an end" or "assignment in condition") than a static analyzer a-la findbugs ("X might be null here" or "access to a field before initialization").

Yeah, that's right. Unfortunately different people put different meaning into "static analyzer". Obviously linting is also done via static analysis of the code.
Post reply on HN