No commit activity in last 3 years
No release in over 3 years
Update obsolete rubocop configuration.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Rubocop Config Updater

Rubocop requires a lot of changes to its config if you didn't update it for a long time. That's why I wrote this gem, because I was tired of manually changing the configuration file. There is already mry gem that solves the same problem, but it's a bit outdated.

This gem handles rubocop's stderr output, therefore it won't shouldn't get outdated. More info about how this gem works and what kind of errors it deals with, can be found in the section #how-it-works

Installation

Install

Add this line to your application's Gemfile:

gem 'rubocop_config_updater', require: false

And then execute:

bundle install

Or preferred install it yourself as:

gem install rubocop_config_updater

After usage you can uninstall with:

gem cleanup rubocop_config_updater

Usage

Usage: rubocop_config_updater [options]
    -c, --config PATH                Rubocop config path, i.e. .rubocop.yml
        --rubocop COMMAND            Rubocop command, i.e. bundle exec rubocop
    -v, --version

How it works

This gem runs a command against rubocop and collects errors from STDERR, which are used to update rubocop's configuration file. If you are interested in Rubocop's code responsible for the above mentioned errors, here is a link to Rubocop's config_obsoletion class

Errors that are solved

  • Renamed cops
    Naming/UncommunicativeMethodParamName will be changed to Naming/MethodParameterName
  • Moved cops
    Security/Eval will be changed to Lint/Eval
  • Renamed parameters
    SafeMode will be changed to SafeAutoCorrect
  • Missing department
    MethodLength will be changed to Metrics/MethodLength

Errors that you have to manually solve

  • Removed cops
  • Splitted cops
  • Obsolete parameters

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. 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, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

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

License

The gem is available as open source under the terms of the MIT License.