Skip to content

Commit 981fdeb

Browse files
committed
Upgrade RuboCop
1 parent d34cf3a commit 981fdeb

12 files changed

Lines changed: 114 additions & 77 deletions

.rubocop.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ Metrics:
1515
# Configured cops
1616
#
1717

18-
# Align ends correctly.
19-
Lint/EndAlignment:
20-
EnforcedStyleAlignWith: variable
21-
2218
# Indentation of when in a case/when/[else/]end.
2319
Layout/CaseIndentation:
2420
EnforcedStyle: end
2521

22+
# Align ends correctly.
23+
Layout/EndAlignment:
24+
EnforcedStyleAlignWith: variable
25+
2626
#
2727
# Disabled lint cops
2828
#
@@ -46,3 +46,14 @@ Style/GuardClause:
4646
# Favor modifier if/unless usage when you have a single-line body.
4747
Style/IfUnlessModifier:
4848
Enabled: false
49+
50+
Naming/UncommunicativeMethodParamName:
51+
AllowedNames:
52+
- at
53+
- by
54+
- cx
55+
- id
56+
- in
57+
- io
58+
- on
59+
- to

.rubocop_todo.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2017-03-30 10:28:14 +1100 using RuboCop version 0.48.0.
3+
# on 2018-04-23 12:01:59 +0200 using RuboCop version 0.55.0.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
@@ -12,12 +12,10 @@ Lint/RescueException:
1212
- 'lib/active_record_host_pool/pool_proxy.rb'
1313
- 'test/test_arhp_wrong_db.rb'
1414

15-
# Offense count: 3
15+
# Offense count: 1
1616
Security/Eval:
1717
Exclude:
18-
- 'test/helper.rb'
1918
- 'test/test_arhp.rb'
20-
- 'test/test_arhp_wrong_db.rb'
2119

2220
# Offense count: 5
2321
Style/Documentation:
@@ -30,33 +28,48 @@ Style/Documentation:
3028
- 'lib/active_record_host_pool/pool_proxy.rb'
3129

3230
# Offense count: 3
31+
Style/EvalWithLocation:
32+
Exclude:
33+
- 'test/helper.rb'
34+
- 'test/test_arhp.rb'
35+
- 'test/test_arhp_wrong_db.rb'
36+
37+
# Offense count: 8
3338
# Cop supports --auto-correct.
34-
# Configuration parameters: EnforcedStyle, SupportedStyles.
39+
# Configuration parameters: EnforcedStyle.
3540
# SupportedStyles: when_needed, always, never
3641
Style/FrozenStringLiteralComment:
3742
Exclude:
3843
- 'Gemfile'
3944
- 'Rakefile'
4045
- 'active_record_host_pool.gemspec'
46+
- 'gemfiles/rails3.2.gemfile'
47+
- 'gemfiles/rails4.2.gemfile'
48+
- 'gemfiles/rails5.0.gemfile'
49+
- 'gemfiles/rails5.1.gemfile'
50+
- 'gemfiles/rails5.2.gemfile'
4151

4252
# Offense count: 1
4353
# Cop supports --auto-correct.
44-
# Configuration parameters: AutoCorrect, EnforcedStyle, SupportedStyles.
54+
# Configuration parameters: AutoCorrect, EnforcedStyle.
4555
# SupportedStyles: predicate, comparison
4656
Style/NumericPredicate:
4757
Exclude:
4858
- 'spec/**/*'
4959
- 'lib/active_record_host_pool/connection_adapter_mixin.rb'
5060

51-
# Offense count: 43
61+
# Offense count: 58
5262
# Cop supports --auto-correct.
53-
# Configuration parameters: EnforcedStyle, SupportedStyles, ConsistentQuotesInMultiline.
63+
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
5464
# SupportedStyles: single_quotes, double_quotes
5565
Style/StringLiterals:
5666
Exclude:
5767
- 'Gemfile'
5868
- 'active_record_host_pool.gemspec'
5969
- 'gemfiles/common.rb'
70+
- 'gemfiles/rails3.2.gemfile'
71+
- 'gemfiles/rails4.2.gemfile'
72+
- 'gemfiles/rails5.0.gemfile'
6073
- 'lib/active_record_host_pool/connection_adapter_mixin.rb'
6174
- 'lib/active_record_host_pool/pool_proxy.rb'
6275
- 'lib/active_record_host_pool/version.rb'
@@ -71,7 +84,13 @@ Style/TrivialAccessors:
7184

7285
# Offense count: 2
7386
# Cop supports --auto-correct.
74-
# Configuration parameters: SupportedStyles, MinSize, WordRegex.
87+
# Configuration parameters: MinSize, WordRegex.
7588
# SupportedStyles: percent, brackets
7689
Style/WordArray:
7790
EnforcedStyle: brackets
91+
92+
# Offense count: 27
93+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
94+
# URISchemes: http, https
95+
Metrics/LineLength:
96+
Max: 130

active_record_host_pool.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Gem::Specification.new do |s|
3030
s.add_development_dependency("mysql2")
3131
s.add_development_dependency("phenix")
3232
s.add_development_dependency("rake", '>= 12.0.0')
33-
s.add_development_dependency('rubocop', '>= 0.48.0')
33+
s.add_development_dependency('rubocop', '>= 0.55.0')
3434
s.add_development_dependency("shoulda")
3535
s.add_development_dependency("wwtd")
3636
end

gemfiles/rails3.2.gemfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
source "https://rubygems.org"
22

3-
gemspec :path => "../"
3+
gemspec path: "../"
44

5-
gem "mysql2", "~> 0.3.0"
65
gem "activerecord", "~> 3.2.22"
6+
gem "mysql2", "~> 0.3.0"
77
gem "test-unit-minitest"
88

99
eval_gemfile 'common.rb'

gemfiles/rails3.2.gemfile.lock

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ GEM
1919
i18n (~> 0.6, >= 0.6.4)
2020
multi_json (~> 1.0)
2121
arel (3.0.3)
22-
ast (2.3.0)
22+
ast (2.4.0)
2323
builder (3.0.4)
2424
bump (0.5.3)
2525
byebug (9.0.6)
@@ -30,21 +30,23 @@ GEM
3030
metaclass (~> 0.0.1)
3131
multi_json (1.12.1)
3232
mysql2 (0.3.21)
33-
parser (2.4.0.0)
34-
ast (~> 2.2)
33+
parallel (1.12.1)
34+
parser (2.5.1.0)
35+
ast (~> 2.4.0)
3536
phenix (0.2.0)
3637
activerecord (>= 3.2, < 5.1)
3738
bundler
3839
powerpack (0.1.1)
39-
rainbow (2.2.1)
40+
rainbow (3.0.0)
4041
rake (12.0.0)
41-
rubocop (0.48.0)
42-
parser (>= 2.3.3.1, < 3.0)
42+
rubocop (0.55.0)
43+
parallel (~> 1.10)
44+
parser (>= 2.5)
4345
powerpack (~> 0.1)
44-
rainbow (>= 1.99.1, < 3.0)
46+
rainbow (>= 2.2.2, < 4.0)
4547
ruby-progressbar (~> 1.7)
4648
unicode-display_width (~> 1.0, >= 1.0.1)
47-
ruby-progressbar (1.8.1)
49+
ruby-progressbar (1.9.0)
4850
shoulda (3.5.0)
4951
shoulda-context (~> 1.0, >= 1.0.1)
5052
shoulda-matchers (>= 1.4.1, < 3.0)
@@ -54,7 +56,7 @@ GEM
5456
test-unit-minitest (0.9.1)
5557
minitest (~> 4.7)
5658
tzinfo (0.3.53)
57-
unicode-display_width (1.1.3)
59+
unicode-display_width (1.3.2)
5860
wwtd (1.3.0)
5961

6062
PLATFORMS
@@ -69,10 +71,10 @@ DEPENDENCIES
6971
mysql2 (~> 0.3.0)
7072
phenix
7173
rake (>= 12.0.0)
72-
rubocop (>= 0.48.0)
74+
rubocop (>= 0.55.0)
7375
shoulda
7476
test-unit-minitest
7577
wwtd
7678

7779
BUNDLED WITH
78-
1.15.4
80+
1.16.1

gemfiles/rails4.2.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source "https://rubygems.org"
22

3-
gemspec :path => "../"
3+
gemspec path: "../"
44

55
gem "activerecord", "~> 4.2.0"
66

gemfiles/rails4.2.gemfile.lock

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ GEM
2020
thread_safe (~> 0.3, >= 0.3.4)
2121
tzinfo (~> 1.1)
2222
arel (6.0.4)
23-
ast (2.3.0)
23+
ast (2.4.0)
2424
builder (3.2.3)
2525
bump (0.5.3)
2626
byebug (9.0.6)
@@ -30,21 +30,23 @@ GEM
3030
mocha (1.2.1)
3131
metaclass (~> 0.0.1)
3232
mysql2 (0.4.5)
33-
parser (2.4.0.0)
34-
ast (~> 2.2)
33+
parallel (1.12.1)
34+
parser (2.5.1.0)
35+
ast (~> 2.4.0)
3536
phenix (0.2.0)
3637
activerecord (>= 3.2, < 5.1)
3738
bundler
3839
powerpack (0.1.1)
39-
rainbow (2.2.1)
40+
rainbow (3.0.0)
4041
rake (12.0.0)
41-
rubocop (0.48.0)
42-
parser (>= 2.3.3.1, < 3.0)
42+
rubocop (0.55.0)
43+
parallel (~> 1.10)
44+
parser (>= 2.5)
4345
powerpack (~> 0.1)
44-
rainbow (>= 1.99.1, < 3.0)
46+
rainbow (>= 2.2.2, < 4.0)
4547
ruby-progressbar (~> 1.7)
4648
unicode-display_width (~> 1.0, >= 1.0.1)
47-
ruby-progressbar (1.8.1)
49+
ruby-progressbar (1.9.0)
4850
shoulda (3.5.0)
4951
shoulda-context (~> 1.0, >= 1.0.1)
5052
shoulda-matchers (>= 1.4.1, < 3.0)
@@ -54,7 +56,7 @@ GEM
5456
thread_safe (0.3.6)
5557
tzinfo (1.2.3)
5658
thread_safe (~> 0.1)
57-
unicode-display_width (1.1.3)
59+
unicode-display_width (1.3.2)
5860
wwtd (1.3.0)
5961

6062
PLATFORMS
@@ -69,9 +71,9 @@ DEPENDENCIES
6971
mysql2
7072
phenix
7173
rake (>= 12.0.0)
72-
rubocop (>= 0.48.0)
74+
rubocop (>= 0.55.0)
7375
shoulda
7476
wwtd
7577

7678
BUNDLED WITH
77-
1.15.4
79+
1.16.1

gemfiles/rails5.0.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source "https://rubygems.org"
22

3-
gemspec :path => "../"
3+
gemspec path: "../"
44

55
gem "activerecord", "~> 5.0.0"
66

gemfiles/rails5.0.gemfile.lock

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ GEM
1919
minitest (~> 5.1)
2020
tzinfo (~> 1.1)
2121
arel (7.1.4)
22-
ast (2.3.0)
22+
ast (2.4.0)
2323
bump (0.5.3)
2424
byebug (9.0.6)
2525
concurrent-ruby (1.0.5)
@@ -29,21 +29,23 @@ GEM
2929
mocha (1.2.1)
3030
metaclass (~> 0.0.1)
3131
mysql2 (0.4.5)
32-
parser (2.4.0.0)
33-
ast (~> 2.2)
32+
parallel (1.12.1)
33+
parser (2.5.1.0)
34+
ast (~> 2.4.0)
3435
phenix (0.2.0)
3536
activerecord (>= 3.2, < 5.1)
3637
bundler
3738
powerpack (0.1.1)
38-
rainbow (2.2.1)
39+
rainbow (3.0.0)
3940
rake (12.0.0)
40-
rubocop (0.48.0)
41-
parser (>= 2.3.3.1, < 3.0)
41+
rubocop (0.55.0)
42+
parallel (~> 1.10)
43+
parser (>= 2.5)
4244
powerpack (~> 0.1)
43-
rainbow (>= 1.99.1, < 3.0)
45+
rainbow (>= 2.2.2, < 4.0)
4446
ruby-progressbar (~> 1.7)
4547
unicode-display_width (~> 1.0, >= 1.0.1)
46-
ruby-progressbar (1.8.1)
48+
ruby-progressbar (1.9.0)
4749
shoulda (3.5.0)
4850
shoulda-context (~> 1.0, >= 1.0.1)
4951
shoulda-matchers (>= 1.4.1, < 3.0)
@@ -53,7 +55,7 @@ GEM
5355
thread_safe (0.3.6)
5456
tzinfo (1.2.3)
5557
thread_safe (~> 0.1)
56-
unicode-display_width (1.1.3)
58+
unicode-display_width (1.3.2)
5759
wwtd (1.3.0)
5860

5961
PLATFORMS
@@ -68,9 +70,9 @@ DEPENDENCIES
6870
mysql2
6971
phenix
7072
rake (>= 12.0.0)
71-
rubocop (>= 0.48.0)
73+
rubocop (>= 0.55.0)
7274
shoulda
7375
wwtd
7476

7577
BUNDLED WITH
76-
1.15.4
78+
1.16.1

0 commit comments

Comments
 (0)