Project

meowcop

0.06
A long-lived project that still receives updates
MeowCop is a RuboCop configuration recommended by Sider.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Development

>= 2.1
>= 5.14
>= 13.0

Runtime

>= 1.13.0, < 2.0.0
 Project Readme

MeowCop

Gem Version

MeowCop is a gem for shareable RuboCop configuration, it focuses on lint (not style). It's recommended by Sider.

Design

RuboCop has many stylistic rules (RuboCop calls a rule "Cop"). "Style Cops" provide one of several settings. So, we encounter many many warnings when we introduce RuboCop. The cause is a mismatch between the RuboCop's default settings and your project's coding style.

In the configuration of MeowCop, almost all stylistic rules are disabled. Because such rules are almost specific for your project. If you want, you can use RuboCop as a linter without many noisy warnings.

In contrast, if you want to use RuboCop as a style checker, we recommend Gry.

Installation

Add this line to your application's Gemfile:

gem 'meowcop'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install meowcop

Configuration

MeowCop provides a CLI tool to initialize .rubocop.yml. See below:

$ meowcop init
Meow! .rubocop.yml has been created successfully.

$ cat .rubocop.yml
# To use the MeowCop gem.
inherit_gem:
  meowcop:
    - config/rubocop.yml

# You can customize RuboCop settings.
# For example.
# Style/FrozenStringLiteralComment:
#   Enabled: true
#   EnforcedStyle: always

See this example.

Usage

Just execute RuboCop with .rubocop.yml configured by MeowCop:

$ bundle exec rubocop

Or,

$ rubocop

Development

After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run:

$ bundle exec rake install

To release a new version,

  1. Move to the main branch and fetch the latest revision. E.g. git checkout main && git pull
  2. Update the version number in version.rb.
  3. Update the changelog.
  4. Commit the updated files with the following message: Release x.y.z
  5. Run the bundle exec rake release command. This command will:
    • create a git tag for the new version
    • push the git commit and tag
    • push the .gem file to rubygems.org

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/sider/meowcop.