mry 0.51.0.0 → 0.52.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +6 -6
- data/lib/mry/added_cops.rb +31 -1
- data/lib/mry/rewriters.rb +6 -0
- data/lib/mry/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd762e726ed1b37d981d592c615ef04ec49e2e3e
|
4
|
+
data.tar.gz: 0d75d6869075114267dbf6e632de91f971420824
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84b6dfb378db69f13820789269f831ac43e09708d5f46bb444b70bcc57bc991df404556dd5fc58e7445fc86bbe1141f79bf7242530ac910326a30a2a264dc278
|
7
|
+
data.tar.gz: ce570da53bd36e88fb8eed66064b9b2117d0d5b2015c548d37cfb0b7eb67e4810a6be99f3de4e282cb4382ee3d235c03a6953540571d2c2498001eceabe24c6a
|
data/README.md
CHANGED
@@ -4,8 +4,8 @@ Mry Migrates .Rubocop.Yml :muscle:
|
|
4
4
|
|
5
5
|
|
6
6
|
RuboCop has many many breaking changes, because it is before version 1.0.
|
7
|
-
So, if you update RuboCop version,
|
8
|
-
This tool supports migrating `.rubocop.yml`. It automatically
|
7
|
+
So, if you update your RuboCop version, .rubocop.yml breaks in many cases...
|
8
|
+
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!
|
9
9
|
|
10
10
|
## Installation
|
11
11
|
|
@@ -31,15 +31,15 @@ Update `.rubocop.yml` to latest release:
|
|
31
31
|
$ mry .rubocop.yml
|
32
32
|
```
|
33
33
|
|
34
|
-
Update `.rubocop.yml` to version
|
34
|
+
Update `.rubocop.yml` to a specified version:
|
35
35
|
|
36
36
|
```bash
|
37
37
|
$ mry --target=0.51.0 .rubocop.yml
|
38
38
|
```
|
39
39
|
|
40
|
-
And you can specify current RuboCop version.
|
41
|
-
If you specify
|
42
|
-
|
40
|
+
And you can specify the current RuboCop version.
|
41
|
+
If you specify a new RuboCop version, mry adds cops that were added in this new RuboCop version to your `.rubocop.yml`.
|
42
|
+
With this feature, you can check new RuboCop cops with mry.
|
43
43
|
|
44
44
|
```bash
|
45
45
|
$ mry --from=0.50.0 --target=0.51.0 .rubocop.yml
|
data/lib/mry/added_cops.rb
CHANGED
@@ -1,6 +1,32 @@
|
|
1
1
|
module Mry
|
2
2
|
module AddedCops
|
3
3
|
Cops = {
|
4
|
+
Gem::Version.new('0.52.0') => %w[
|
5
|
+
Style/StringHashKeys
|
6
|
+
Style/RandomWithOffset
|
7
|
+
Lint/ShadowedArgument
|
8
|
+
Lint/MissingCopEnableDirective
|
9
|
+
Rails/EnvironmentComparison
|
10
|
+
Style/EmptyBlockParameter
|
11
|
+
Style/EmptyLambdaParameter
|
12
|
+
Style/TrailingBodyOnMethodDefinition
|
13
|
+
Rails/InverseOf
|
14
|
+
Style/TrailingMethodEndStatement
|
15
|
+
Gemspec/RequiredRubyVersion
|
16
|
+
Lint/NestedPercentLiteral
|
17
|
+
Gemspec/DuplicatedAssignment
|
18
|
+
Style/ColonMethodDefinition
|
19
|
+
Layout/ClassStructure
|
20
|
+
Rails/CreateTableWithTimestamps
|
21
|
+
Style/ExtendSelf
|
22
|
+
Rails/RedundantReceiverInWithOptions
|
23
|
+
Style/EvalWithLocation
|
24
|
+
Layout/EmptyLinesAroundArguments
|
25
|
+
Layout/SpaceInsideReferenceBrackets
|
26
|
+
Layout/SpaceInsideArrayLiteralBrackets
|
27
|
+
Rails/LexicallyScopedActionFilter
|
28
|
+
Rails/Presence
|
29
|
+
],
|
4
30
|
Gem::Version.new('0.51.0') => %w[
|
5
31
|
Rails/UnknownEnv
|
6
32
|
Style/StderrPuts
|
@@ -147,7 +173,11 @@ module Mry
|
|
147
173
|
cops = added_cops(from: from, to: to)
|
148
174
|
return if cops.empty?
|
149
175
|
|
150
|
-
in_tmpdir do
|
176
|
+
in_tmpdir do |dir|
|
177
|
+
dir.join('.rubocop.yml').write(<<~YAML)
|
178
|
+
Rails:
|
179
|
+
Enabled: true
|
180
|
+
YAML
|
151
181
|
stdout do
|
152
182
|
RuboCop::CLI.new.run(['--show-cops', cops.join(',')])
|
153
183
|
end
|
data/lib/mry/rewriters.rb
CHANGED
@@ -3,6 +3,10 @@ module Mry
|
|
3
3
|
class Rewriter_Master < YAMLRewriter::Rewriter
|
4
4
|
end
|
5
5
|
|
6
|
+
class Rewriter_0_52_0 < YAMLRewriter::Rewriter
|
7
|
+
define_rule ['Lint/RescueWithoutErrorClass' => 'Style/RescueStandardError']
|
8
|
+
end
|
9
|
+
|
6
10
|
class Rewriter_0_51_0 < YAMLRewriter::Rewriter
|
7
11
|
define_rule ['Lint/LiteralInCondition' => 'Lint/LiteralAsCondition']
|
8
12
|
end
|
@@ -136,6 +140,7 @@ module Mry
|
|
136
140
|
class Rewriter_0_41_0 < YAMLRewriter::Rewriter
|
137
141
|
define_rule ['Style/DeprecatedHashMethods' => 'Style/PreferredHashMethods']
|
138
142
|
end
|
143
|
+
|
139
144
|
class Rewriter_0 < YAMLRewriter::Rewriter
|
140
145
|
define_rule ['Style/SingleSpaceBeforeFirstArg' => 'Style/SpaceBeforeFirstArg']
|
141
146
|
define_rule ['Lint/SpaceBeforeFirstArg' => 'Style/SpaceBeforeFirstArg']
|
@@ -145,6 +150,7 @@ module Mry
|
|
145
150
|
end
|
146
151
|
|
147
152
|
Rewriters = {
|
153
|
+
Gem::Version.new('0.52.0') => Rewriter_0_51_0,
|
148
154
|
Gem::Version.new('0.51.0') => Rewriter_0_51_0,
|
149
155
|
Gem::Version.new('0.50.0') => Rewriter_0_50_0,
|
150
156
|
Gem::Version.new('0.49.0') => Rewriter_0_49_0,
|
data/lib/mry/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.52.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masataka Kuwabara
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|