Hello! This is pocke, the RuboCop lover!
I’m happy to inform you of the release of MeowCop, a Gem for configuring RuboCop.
Default settings for RuboCop are hard to use…
You may ask, what lead to the release of this Gem?
Well, there was a problem that RuboCop’s default settings were a bit awkward to use.
RuboCop provides a lot of rules, and many of them are enabled by default.
This means that RuboCop verifies various rules for you without any configurations.
However, from a different perspective, this also means that RuboCop will emit many, many warnings if you don’t configure it yourself. A situation like this is a big obstacle in introducing RuboCop.
Why will there be so many warnings?
So, why will there be so many warnings?
The answer is because RuboCop checks the coding style of Ruby codes.
There are many coding styles, differing between people, companies, projects, and so on.
So, when you use the default settings fo/Users/KF/Downloads/ブログ記事翻訳依頼_translated/blog_article_2_engr RuboCop, a tool for general use, a ton of warnings occur, because the configurations are not optimized for each project.
A solution: not indicating coding style problems at all
MeowCop can solve this problem.
MeowCop disables rules that are different for each project, such as ones concerning coding style.
Rules not about style are left enabled, like codes that can lead to bugs or problems concerning performance.
Like this, MeowCop allows you to effectively introduce RuboCop without having to worry about those heaps of warnings.
If it becomes necessary to enable those rules concerning style after introducing MeowCop, you can overwrite the settings in
How to install
Install the gem using the following command:
$ gem install rubocop meowcop
or, add the following code to your
gem 'rubocop', require: false
gem 'meowcop', require: false
Also, you need to add the code below to your
If you don’t have a
.rubocop.yml, please create one.
By executing the
rubocop command with these settings, Rubocop will run with the settings by MeowCop applied.
By using MeowCop, you can introduce RuboCop, starting with only the rules that can be used in any project.
If you want to introduce RuboCop, but feel like making those config files following the style guides is a hard task, do give it a try!
Also, MeowCop can be used on SideCI, immediately.
It should be noted that when you execute RuboCop on SideCI, the settings by MeowCop are used for repositories that don’t have a
More articles about RuboCop
- Trying the Rails or Lint options in RuboCop
- Using RuboCop for quick automated code reviews with Docker
- Use RuboCop to check the conformity of your Ruby code with the style guide
- Analyzing code with RuboCop on a Ruby on Rails project
- Extract Hidden Coding Styles to .rubocop.yml with Gry
- Educate RuboCop, try out rubocop.yml which prioritize the speed to the rules
For more information about Sider, please go to our website.