RuboCop – A Ruby static code analyzer
batsov.com
RuboCop – A Ruby static code analyzer
1–10 of 39 posts
Re: RuboCop – A Ruby static code analyzer
#2Re: RuboCop – A Ruby static code analyzer
#3Working link to the real thing http://batsov.com/rubocop/
Submitters: HN prefers original sources. https://news.ycombinator.com/newsguidelines.html
Re: RuboCop – A Ruby static code analyzer
#4Re: RuboCop – A Ruby static code analyzer
#5For more than just Ruby, as well: https://houndci.com/
Re: RuboCop – A Ruby static code analyzer
#6Re: RuboCop – A Ruby static code analyzer
#7Re: RuboCop – A Ruby static code analyzer
#8Is 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.
Re: RuboCop – A Ruby static code analyzer
#9Is 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.
Re: RuboCop – A Ruby static code analyzer
#10Is 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.
Rather than running it one file at a time, I found that I got an easier to inspect diff by running it one cop at a time. Rubocop simplifies this approach by allowing you to auto-generate a '.rubocop_todo.yml' file that specifies settings for every 'cop' that would allow your project to produce no warnings. Then you just remove one section of config at a time, autocorrect or manually correct all the errors that pop up, and make a commit describing what style change it introduced across the project. In the process, you also gain a full understanding of really what is required by the cops - there are a couple that I have tuned to be more relaxed than the default, because the defaults seem silly (like cyclomatic complexity, and method length).