• Stars
    star
    208
  • Rank 189,015 (Top 4 %)
  • Language
    Ruby
  • License
    Apache License 2.0
  • Created over 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Mry Migrates .Rubocop.Yml

Mry

Mry Migrates .Rubocop.Yml 💪

RuboCop has many many breaking changes, because it is before version 1.0. So, if you update your RuboCop version, .rubocop.yml breaks in many cases... This tool supports migrating .rubocop.yml. It automatically renames the configuration in your .rubocop.yml that was renamed by the updated RuboCop version. So, with this tool, you do not have to be afraid of updating RuboCop anymore!

Installation

Add this line to your application's Gemfile:

gem 'mry'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mry

Usage

Update .rubocop.yml to latest release:

$ mry .rubocop.yml

Update .rubocop.yml to a specified version:

$ mry --target=0.51.0 .rubocop.yml

And you can specify the current RuboCop version. If you specify a new RuboCop version, mry adds cops that were added in this new RuboCop version to your .rubocop.yml. With this feature, you can check new RuboCop cops with mry.

$ mry --from=0.50.0 --target=0.51.0 .rubocop.yml
$ cat .rubocop.yml
...


# The following cops are added between 0.50.0 and 0.51.0.
# The configurations are default.
# If you want to use a cop by default, remove a configuration for the cop from here.
# If you want to disable a cop, change `Enabled` to false.

# Supports --auto-correct
Gemspec/OrderedDependencies:
  Description: Dependencies in the gemspec should be alphabetically sorted.
  Enabled: true
  Include:
  - "**/*.gemspec"
  TreatCommentsAsGroupSeparators: true

# Supports --auto-correct
Lint/RedundantWithObject:
  Description: Checks for redundant `with_object`.
  Enabled: true

...

Example

Example Animation

Development

How to support new version RuboCop

Run bin/check_rubocop_update script (depend on Ruby 2.6 or higher). This script displays renamed, added and deleted cop names.

# Clone rubocop repository if it does not exist.
$ git clone https://github.com/rubocop-hq/rubocop/ ~/path/to/rubocop/
$ bin/check_rubocop_update v0.55.0 v0.56.0 ~/path/to/rubocop/

(...log...)

:added:
- Lint/SplatKeywordArguments
- Performance/InefficientHashSearch
- Lint/ErbNewArguments
- Rails/AssertNot
- Rails/RefuteMethods
:renamed:
- :before:
  - Style/EmptyLineAfterGuardClause
  :after:
  - Layout/EmptyLineAfterGuardClause
- :before:
  - Style/MethodMissing
  :after:
  - Style/MethodMissingSuper
  - Style/MissingRespondToMissing
:deleted: []

Update lib/mry/added_cops.rb and lib/mry/rewriters.rb with this result.

Note: Mry does not support deleted cops and split cops. See #37 and #38.

Contributing

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

License

Copyright 2017-2018 Masataka Pocke Kuwabara

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

More Repositories

1

rbs_rails

Ruby
241
star
2

gry

Gry generates .rubocop.yml automatically
Ruby
86
star
3

whichpr

Find the pull request from commit hash.
Go
84
star
4

iro.vim

Iro.vim is a Vim plugin that is a next generation syntax highlighter.
Ruby
63
star
5

www

The easiest web server for static files
Go
46
star
6

sushibar.vim

Vim ❤️ 🍣
Vim Script
40
star
7

overloader

Overload for Ruby
Ruby
38
star
8

iro

Iro is a library for syntax highlighting.
Ruby
33
star
9

keycast.vim

Display key strokes on Vim.
Vim Script
32
star
10

ptmux

Specify GitHub repository metadata from a file
Go
27
star
11

merge_db_schema

It is a git merge driver for db/schema.rb of Ruby on Rails. It resolves some of the conflict automatically.
Ruby
21
star
12

rubocop-typed

RuboCop with type
Ruby
17
star
13

rpr

RPR displays Ruby's AST on command line.
Ruby
15
star
14

dotfiles

dotfiles / public domain
Vim Script
14
star
15

get

get a repository
Go
14
star
16

xrandr-mirror

Mirroring displays on Linux
Go
13
star
17

goevent

goevent is event dispatcher written by golang.
Go
13
star
18

dicts

Dictionaries for neocomplete.vim
Ruby
12
star
19

resume

12
star
20

rubocop-grep

Ruby
11
star
21

emo

Emo suggests you emoji. ☂🐺😕🐠🕗
Go
10
star
22

arpry

Pry with Active Record. Without Rails.
Ruby
10
star
23

gem-src-srv

Run git clone after gem install concurrently. Inspired by gem-src
Ruby
10
star
24

all-gem

all-gem runs various versions of command provided by gem.
Ruby
10
star
25

yaml-path.vim

Display the path of YAML on cursor.
Vim Script
9
star
26

gfm-viewer

gfm-viewer is GitHub Flavored markdown Viewer.
Go
9
star
27

tnite.vim

Apply action to output of :terminal. It's simple.
Vim Script
8
star
28

sl_tweet

slコマンドが走りました(3時間振り5回目)
Ruby
7
star
29

akaza

A cool Whitespace language implementation in Ruby.
Ruby
7
star
30

Japanese

グローバル変数に日本語の別名をつけます。
Ruby
6
star
31

rbs.vim

Syntax plugin for RBS
Vim Script
6
star
32

mi

Better `rails g migration`
Ruby
6
star
33

todofuken

Create a master table of Japanese Prefectures for Ruby on Rails as a generator.
Ruby
6
star
34

rubykaigi-2021

6
star
35

stackprof-run

Run a ruby script with stackprof.
Ruby
5
star
36

flowterm

String flows in a terminal.
Ruby
5
star
37

equire

Ruby
5
star
38

swift-ide-test-comp.vim

Omni completion for swift (Work on Linux!)
Vim Script
5
star
39

infra2

Ruby
5
star
40

go-minisat

Golang binding for Minisat
Go
4
star
41

recc

Record command and output.
Go
4
star
42

cuculus.vim

`%` for Ruby.
Ruby
4
star
43

neco-gh-issues

A neocomplete source. This plugin completes github issues when you're editing commit message.
Vim Script
4
star
44

serverspec.vim

Neosnippet source for Serverspec.
Ruby
4
star
45

ika2.vim

Vim Script
4
star
46

rinline

Inline expansion for Ruby
Ruby
4
star
47

cookpad-summer-internship-2016-meshitero

3
star
48

vim-textobj-markdown

Vim Script
3
star
49

dentaku

Go
3
star
50

vanner

An implementation of banner written in Vim script.
Vim Script
3
star
51

mayfly

Mayfly restart the command at regular intervals.
Go
3
star
52

rubocop-rails-order_model_declarative_methods

Sort declarative methods of Rails model, as an extension to RuboCop.
Ruby
3
star
53

master-of-graphql-game

https://graphql-master.netlify.com/
Ruby
3
star
54

rubykaigi-2023-lets-write-rbs

Ruby
3
star
55

10-min-fizzbuzz

Ruby
3
star
56

pry_testcase

Run binding.pry only specified testcase.
Ruby
2
star
57

ajax_set.js

jQuery.ajax() wrapper.
JavaScript
2
star
58

dont_comment

Do not comment out unused code, use version control system instead and remove it!
Ruby
2
star
59

brainfuck-playground

WIP
TypeScript
2
star
60

md2inao-docker

Makefile
2
star
61

exception_notification-bugsnag

Ruby
2
star
62

ppcli

Ruby
2
star
63

crepeat

execute a command while the command returns 0
Go
2
star
64

rubykaigi2017

Ruby
2
star
65

rubocop-configuration_cleaner

.rubocop.yml cleaner
Ruby
2
star
66

ci_against

A CLI tool to Bump Ruby versions in Travis CI automatically.
Ruby
2
star
67

ovto-router

A router for Ovto.
Ruby
2
star
68

gh-feeds

WIP
Go
2
star
69

bacon-cannon

An online Ruby parser
Ruby
2
star
70

salary

HTML
2
star
71

import.rb

Instead of Kernel.require
Ruby
2
star
72

nedb-promise-ts

TypeScript
2
star
73

shouldnot.work

Ruby
2
star
74

twice

Go
2
star
75

HelloAgain

HackDay 2016 で作られた名刺交換の電子化アプリケーション
Ruby
2
star
76

itamae-plugin-resource-aur_package

An Itamae resource for AUR (Arch User Repository)
Ruby
2
star
77

mergecat-terms

1
star
78

mikutter_delete_copy

つい消ししてコピー
Ruby
1
star
79

vim-textobj-rubyexp

Ruby
1
star
80

intellij-serverspec-live-templates

1
star
81

hostop

Go
1
star
82

go-notify

WIP
Go
1
star
83

benchcmp-vcs

benchcmp-vcs is a wrapper of benchcmp.
Go
1
star
84

serverspec-snippets-generator

Ruby
1
star
85

to-gist

Go
1
star
86

fibo

HTML
1
star
87

vueim

Vim ❤️ Vue
Vim Script
1
star
88

fail-on-stderr

exit 1 if stderr is not empty
Go
1
star
89

paizaio

paiza.io API wrapper written by Golang.
Go
1
star
90

tmpgem

Temporary gem installer
Ruby
1
star
91

react-intl-dts

1
star
92

rurema.vim

Vim Script
1
star
93

rbsfmt

Ruby
1
star
94

vim-operator-ruby-rescue

Vim Script
1
star
95

go-iprange

Go
1
star
96

rrrubocop

Ruby
1
star
97

aoj_get_solved

AOJにsubmitしたソースコードを取得します
Ruby
1
star
98

mikutter_vimize

mikutterをVimっぽくする
Ruby
1
star
99

rubocop-regular_expression

Ruby
1
star
100

ikalendar

Ruby
1
star