|
|
|
|
|
by nevinera
4128 days ago
|
|
Rubocop organizes violations into a set of distinct 'cops', each of which is responsible for checking for a single type of style violation - about half of them can be autocorrected (--auto-correct argument from the command line). 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). |
|