Skip to content

Commit b9ba6db

Browse files
committed
Rubocop 0.50.0
* Updated docs * Updated other gems
1 parent 1c49e79 commit b9ba6db

File tree

138 files changed

+2423
-212
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

138 files changed

+2423
-212
lines changed

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ source 'https://rubygems.org'
55
gem "activesupport", require: false
66
gem "parser", "~> 2.4.0"
77
gem "pry", require: false
8-
gem "rubocop", "~> 0.45", require: false
8+
gem "rubocop", "~> 0.50.0", require: false
99
gem "rubocop-migrations", require: false
1010
gem "rubocop-rspec", require: false
1111
gem "safe_yaml"

Gemfile.lock

+35-34
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,58 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
activesupport (5.0.1)
4+
activesupport (5.1.4)
55
concurrent-ruby (~> 1.0, >= 1.0.2)
66
i18n (~> 0.7)
77
minitest (~> 5.1)
88
tzinfo (~> 1.1)
99
ast (2.3.0)
10-
coderay (1.1.1)
11-
concurrent-ruby (1.0.3)
12-
diff-lcs (1.2.5)
13-
i18n (0.7.0)
14-
method_source (0.8.2)
15-
minitest (5.10.1)
10+
coderay (1.1.2)
11+
concurrent-ruby (1.0.5)
12+
diff-lcs (1.3)
13+
i18n (0.8.6)
14+
method_source (0.9.0)
15+
minitest (5.10.3)
16+
parallel (1.12.0)
1617
parser (2.4.0.0)
1718
ast (~> 2.2)
1819
powerpack (0.1.1)
19-
pry (0.10.4)
20+
pry (0.11.1)
2021
coderay (~> 1.1.0)
21-
method_source (~> 0.8.1)
22-
slop (~> 3.4)
23-
rainbow (2.1.0)
24-
rake (12.0.0)
25-
rspec (3.5.0)
26-
rspec-core (~> 3.5.0)
27-
rspec-expectations (~> 3.5.0)
28-
rspec-mocks (~> 3.5.0)
29-
rspec-core (3.5.4)
30-
rspec-support (~> 3.5.0)
31-
rspec-expectations (3.5.0)
22+
method_source (~> 0.9.0)
23+
rainbow (2.2.2)
24+
rake
25+
rake (12.1.0)
26+
rspec (3.6.0)
27+
rspec-core (~> 3.6.0)
28+
rspec-expectations (~> 3.6.0)
29+
rspec-mocks (~> 3.6.0)
30+
rspec-core (3.6.0)
31+
rspec-support (~> 3.6.0)
32+
rspec-expectations (3.6.0)
3233
diff-lcs (>= 1.2.0, < 2.0)
33-
rspec-support (~> 3.5.0)
34-
rspec-mocks (3.5.0)
34+
rspec-support (~> 3.6.0)
35+
rspec-mocks (3.6.0)
3536
diff-lcs (>= 1.2.0, < 2.0)
36-
rspec-support (~> 3.5.0)
37-
rspec-support (3.5.0)
38-
rubocop (0.46.0)
39-
parser (>= 2.3.1.1, < 3.0)
37+
rspec-support (~> 3.6.0)
38+
rspec-support (3.6.0)
39+
rubocop (0.50.0)
40+
parallel (~> 1.10)
41+
parser (>= 2.3.3.1, < 3.0)
4042
powerpack (~> 0.1)
41-
rainbow (>= 1.99.1, < 3.0)
43+
rainbow (>= 2.2.2, < 3.0)
4244
ruby-progressbar (~> 1.7)
4345
unicode-display_width (~> 1.0, >= 1.0.1)
4446
rubocop-migrations (0.1.2)
4547
rubocop (~> 0.41)
46-
rubocop-rspec (1.8.0)
47-
rubocop (>= 0.42.0)
48-
ruby-progressbar (1.8.1)
48+
rubocop-rspec (1.18.0)
49+
rubocop (>= 0.50.0)
50+
ruby-progressbar (1.9.0)
4951
safe_yaml (1.0.4)
50-
slop (3.6.0)
51-
thread_safe (0.3.5)
52-
tzinfo (1.2.2)
52+
thread_safe (0.3.6)
53+
tzinfo (1.2.3)
5354
thread_safe (~> 0.1)
54-
unicode-display_width (1.1.2)
55+
unicode-display_width (1.3.0)
5556

5657
PLATFORMS
5758
ruby
@@ -62,7 +63,7 @@ DEPENDENCIES
6263
pry
6364
rake
6465
rspec
65-
rubocop (~> 0.45)
66+
rubocop (~> 0.50.0)
6667
rubocop-migrations
6768
rubocop-rspec
6869
safe_yaml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The symbol argument `:gemcutter`, `:rubygems` and `:rubyforge`
2+
are deprecated. So please change your source to URL string that
3+
'https://rubygems.org' if possible, or 'http://rubygems.org' if not.
4+
5+
This autocorrect will replace these symbols with 'https://rubygems.org'.
6+
Because it is secure, HTTPS request is strongly recommended. And in
7+
most use cases HTTPS will be fine.
8+
9+
However, it don't replace all `sources` of `http://` with `https://`.
10+
For example, when specifying an internal gem server using HTTP on the
11+
intranet, a use case where HTTPS can not be specified was considered.
12+
Consider using HTTP only if you can not use HTTPS.
13+
14+
### Example:
15+
# bad
16+
source :gemcutter
17+
source :rubygems
18+
source :rubyforge
19+
20+
# good
21+
source 'https://rubygems.org' # strongly recommended
22+
source 'http://rubygems.org'

config/contents/bundler/ordered_gems.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
Gems in consecutive lines should be alphabetically sorted
1+
Gems should be alphabetically sorted within groups.
2+
23
### Example:
34
# bad
45
gem 'rubocop'
@@ -11,4 +12,10 @@ Gems in consecutive lines should be alphabetically sorted
1112
# good
1213
gem 'rubocop'
1314

15+
gem 'rspec'
16+
17+
# good only if TreatCommentsAsGroupSeparators is true
18+
# For code quality
19+
gem 'rubocop'
20+
# For tests
1421
gem 'rspec'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
This cop checks for ambiguous block association with method
2+
when param passed without parentheses.
3+
4+
### Example:
5+
6+
# bad
7+
some_method a { |val| puts val }
8+
9+
### Example:
10+
11+
# good
12+
# With parentheses, there's no ambiguity.
13+
some_method(a) { |val| puts val }
14+
15+
# good
16+
# Operator methods require no disambiguation
17+
foo == bar { |b| b.baz }
18+
19+
# good
20+
# Lambda arguments require no disambiguation
21+
foo = ->(bar) { bar.baz }

config/contents/lint/ambiguous_operator.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@ This cop checks for ambiguous operators in the first argument of a
22
method invocation without parentheses.
33

44
### Example:
5-
array = [1, 2, 3]
5+
6+
# bad
67

78
# The `*` is interpreted as a splat operator but it could possibly be
8-
# a `*` method invocation (i.e. `do_something.*(array)`).
9-
do_something *array
9+
# a `*` method invocation (i.e. `do_something.*(some_array)`).
10+
do_something *some_array
11+
12+
### Example:
13+
14+
# good
1015

1116
# With parentheses, there's no ambiguity.
12-
do_something(*array)
17+
do_something(*some_array)

config/contents/lint/ambiguous_regexp_literal.md

+7
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@ This cop checks for ambiguous regexp literals in the first argument of
22
a method invocation without parentheses.
33

44
### Example:
5+
6+
# bad
7+
58
# This is interpreted as a method invocation with a regexp literal,
69
# but it could possibly be `/` method invocations.
710
# (i.e. `do_something./(pattern)./(i)`)
811
do_something /pattern/i
912

13+
### Example:
14+
15+
# good
16+
1017
# With parentheses, there's no ambiguity.
1118
do_something(/pattern/i)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
This cop checks for assignments in the conditions of
2+
if/while/until.
3+
4+
### Example:
5+
6+
# bad
7+
8+
if some_var = true
9+
do_something
10+
end
11+
12+
### Example:
13+
14+
# good
15+
16+
if some_var == true
17+
do_something
18+
end

config/contents/lint/block_alignment.md

+27-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
This cop checks whether the end keywords are aligned properly for do
22
end blocks.
33

4-
Three modes are supported through the `AlignWith` configuration
5-
parameter:
4+
Three modes are supported through the `EnforcedStyleAlignWith`
5+
configuration parameter:
66

77
`start_of_block` : the `end` shall be aligned with the
88
start of the line where the `do` appeared.
@@ -15,18 +15,40 @@ location. The autofixer will default to `start_of_line`.
1515

1616
### Example:
1717

18-
# either
18+
# bad
19+
20+
foo.bar
21+
.each do
22+
baz
23+
end
24+
25+
### Example:
26+
27+
# EnforcedStyleAlignWith: either (default)
28+
29+
# good
30+
1931
variable = lambda do |i|
2032
i
2133
end
2234

23-
# start_of_block
35+
### Example:
36+
37+
# EnforcedStyleAlignWith: start_of_block
38+
39+
# good
40+
2441
foo.bar
2542
.each do
2643
baz
2744
end
2845

29-
# start_of_line
46+
### Example:
47+
48+
# EnforcedStyleAlignWith: start_of_line
49+
50+
# good
51+
3052
foo.bar
3153
.each do
3254
baz
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
This cop checks for `:true` and `:false` symbols.
2+
In most cases it would be a typo.
3+
4+
### Example:
5+
6+
# bad
7+
:true
8+
9+
# good
10+
true
11+
12+
### Example:
13+
14+
# bad
15+
:false
16+
17+
# good
18+
false

config/contents/lint/circular_argument_reference.md

+14
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,41 @@ arguments and optional ordinal arguments.
44
This cop mirrors a warning produced by MRI since 2.2.
55

66
### Example:
7+
78
# bad
9+
810
def bake(pie: pie)
911
pie.heat_up
1012
end
1113

14+
### Example:
15+
1216
# good
17+
1318
def bake(pie:)
1419
pie.refrigerate
1520
end
1621

22+
### Example:
23+
1724
# good
25+
1826
def bake(pie: self.pie)
1927
pie.feed_to(user)
2028
end
2129

30+
### Example:
31+
2232
# bad
33+
2334
def cook(dry_ingredients = dry_ingredients)
2435
dry_ingredients.reduce(&:+)
2536
end
2637

38+
### Example:
39+
2740
# good
41+
2842
def cook(dry_ingredients = self.dry_ingredients)
2943
dry_ingredients.combine
3044
end

config/contents/lint/condition_position.md

+10
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,17 @@ if/while/until.
33

44
### Example:
55

6+
# bad
7+
68
if
79
some_condition
810
do_something
11+
end
12+
13+
### Example:
14+
15+
# good
16+
17+
if some_condition
18+
do_something
919
end

0 commit comments

Comments
 (0)