Skip to content

Commit aceff1d

Browse files
authored
Update rubocop to 1.30.1 (#317)
- General bundle update. - Update the docs too.
1 parent bdfe78f commit aceff1d

13 files changed

+139
-139
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ gem "activesupport", require: false
66
gem "mry", require: false
77
gem "parser"
88
gem "pry", require: false
9-
gem "rubocop", "1.30.0", require: false
9+
gem "rubocop", "1.30.1", require: false
1010
gem "rubocop-i18n", require: false
1111
gem "rubocop-graphql", require: false
1212
gem "rubocop-minitest", require: false

Gemfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ GEM
4040
diff-lcs (>= 1.2.0, < 2.0)
4141
rspec-support (~> 3.11.0)
4242
rspec-support (3.11.0)
43-
rubocop (1.30.0)
43+
rubocop (1.30.1)
4444
parallel (~> 1.10)
4545
parser (>= 3.1.0.0)
4646
rainbow (>= 2.2.2, < 4.0)
@@ -57,7 +57,7 @@ GEM
5757
rubocop (~> 1.0)
5858
rubocop-minitest (0.20.0)
5959
rubocop (>= 0.90, < 2.0)
60-
rubocop-performance (1.14.0)
60+
rubocop-performance (1.14.1)
6161
rubocop (>= 1.7.0, < 2.0)
6262
rubocop-ast (>= 0.4.0)
6363
rubocop-rails (2.14.2)
@@ -93,7 +93,7 @@ DEPENDENCIES
9393
pry
9494
rake
9595
rspec
96-
rubocop (= 1.30.0)
96+
rubocop (= 1.30.1)
9797
rubocop-graphql
9898
rubocop-i18n
9999
rubocop-minitest
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
Checks if empty lines around the bodies of blocks match
22
the configuration.
33

4-
### Example: EnforcedStyle: empty_lines
4+
### Example: EnforcedStyle: no_empty_lines (default)
55
# good
66

77
foo do |bar|
8-
98
# ...
10-
119
end
1210

13-
### Example: EnforcedStyle: no_empty_lines (default)
11+
### Example: EnforcedStyle: empty_lines
1412
# good
1513

1614
foo do |bar|
15+
1716
# ...
17+
1818
end

config/contents/layout/empty_lines_around_class_body.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
Checks if empty lines around the bodies of classes match
22
the configuration.
33

4+
### Example: EnforcedStyle: no_empty_lines (default)
5+
# good
6+
7+
class Foo
8+
def bar
9+
# ...
10+
end
11+
end
12+
413
### Example: EnforcedStyle: empty_lines
514
# good
615

@@ -49,13 +58,4 @@ the configuration.
4958
# ...
5059
end
5160

52-
end
53-
54-
### Example: EnforcedStyle: no_empty_lines (default)
55-
# good
56-
57-
class Foo
58-
def bar
59-
# ...
60-
end
6161
end

config/contents/layout/empty_lines_around_module_body.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
Checks if empty lines around the bodies of modules match
22
the configuration.
33

4+
### Example: EnforcedStyle: no_empty_lines (default)
5+
# good
6+
7+
module Foo
8+
def bar
9+
# ...
10+
end
11+
end
12+
413
### Example: EnforcedStyle: empty_lines
514
# good
615

@@ -29,13 +38,4 @@ the configuration.
2938

3039
def bar; end
3140

32-
end
33-
34-
### Example: EnforcedStyle: no_empty_lines (default)
35-
# good
36-
37-
module Foo
38-
def bar
39-
# ...
40-
end
4141
end

config/contents/layout/first_argument_indentation.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,10 @@ This cop will respect `Layout/ArgumentAlignment` and will not work when
3232
nested_first_param),
3333
second_param
3434

35-
### Example: EnforcedStyle: consistent
36-
# The first argument should always be indented one step more than the
37-
# preceding line.
35+
### Example: EnforcedStyle: special_for_inner_method_call_in_parentheses (default)
36+
# Same as `special_for_inner_method_call` except that the special rule
37+
# only applies if the outer method call encloses its arguments in
38+
# parentheses.
3839

3940
# good
4041
some_method(
@@ -46,7 +47,7 @@ This cop will respect `Layout/ArgumentAlignment` and will not work when
4647
second_param)
4748

4849
foo = some_method(nested_call(
49-
nested_first_param),
50+
nested_first_param),
5051
second_param)
5152

5253
foo = some_method(
@@ -58,64 +59,63 @@ This cop will respect `Layout/ArgumentAlignment` and will not work when
5859
nested_first_param),
5960
second_param
6061

61-
### Example: EnforcedStyle: consistent_relative_to_receiver
62-
# The first argument should always be indented one level relative to
63-
# the parent that is receiving the argument
62+
### Example: EnforcedStyle: consistent
63+
# The first argument should always be indented one step more than the
64+
# preceding line.
6465

6566
# good
6667
some_method(
6768
first_param,
6869
second_param)
6970

7071
foo = some_method(
71-
first_param,
72+
first_param,
7273
second_param)
7374

7475
foo = some_method(nested_call(
75-
nested_first_param),
76+
nested_first_param),
7677
second_param)
7778

7879
foo = some_method(
79-
nested_call(
80-
nested_first_param),
80+
nested_call(
81+
nested_first_param),
8182
second_param)
8283

8384
some_method nested_call(
84-
nested_first_param),
85-
second_params
85+
nested_first_param),
86+
second_param
8687

87-
### Example: EnforcedStyle: special_for_inner_method_call
88-
# The first argument should normally be indented one step more than
89-
# the preceding line, but if it's a argument for a method call that
90-
# is itself a argument in a method call, then the inner argument
91-
# should be indented relative to the inner method.
88+
### Example: EnforcedStyle: consistent_relative_to_receiver
89+
# The first argument should always be indented one level relative to
90+
# the parent that is receiving the argument
9291

9392
# good
9493
some_method(
9594
first_param,
9695
second_param)
9796

9897
foo = some_method(
99-
first_param,
98+
first_param,
10099
second_param)
101100

102101
foo = some_method(nested_call(
103102
nested_first_param),
104103
second_param)
105104

106105
foo = some_method(
107-
nested_call(
108-
nested_first_param),
106+
nested_call(
107+
nested_first_param),
109108
second_param)
110109

111110
some_method nested_call(
112111
nested_first_param),
113-
second_param
112+
second_params
114113

115-
### Example: EnforcedStyle: special_for_inner_method_call_in_parentheses (default)
116-
# Same as `special_for_inner_method_call` except that the special rule
117-
# only applies if the outer method call encloses its arguments in
118-
# parentheses.
114+
### Example: EnforcedStyle: special_for_inner_method_call
115+
# The first argument should normally be indented one step more than
116+
# the preceding line, but if it's a argument for a method call that
117+
# is itself a argument in a method call, then the inner argument
118+
# should be indented relative to the inner method.
119119

120120
# good
121121
some_method(
@@ -136,5 +136,5 @@ This cop will respect `Layout/ArgumentAlignment` and will not work when
136136
second_param)
137137

138138
some_method nested_call(
139-
nested_first_param),
139+
nested_first_param),
140140
second_param

config/contents/layout/space_inside_array_literal_brackets.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
Checks that brackets used for array literals have or don't have
22
surrounding space depending on configuration.
33

4-
### Example: EnforcedStyle: space
5-
# The `space` style enforces that array literals have
6-
# surrounding space.
7-
8-
# bad
9-
array = [a, b, c, d]
10-
11-
# good
12-
array = [ a, b, c, d ]
13-
144
### Example: EnforcedStyle: no_space (default)
155
# The `no_space` style enforces that array literals have
166
# no surrounding space.
@@ -21,6 +11,16 @@ surrounding space depending on configuration.
2111
# good
2212
array = [a, b, c, d]
2313

14+
### Example: EnforcedStyle: space
15+
# The `space` style enforces that array literals have
16+
# surrounding space.
17+
18+
# bad
19+
array = [a, b, c, d]
20+
21+
# good
22+
array = [ a, b, c, d ]
23+
2424
### Example: EnforcedStyle: compact
2525
# The `compact` style normally requires a space inside
2626
# array brackets, with the exception that successive left
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
Looks for trailing blank lines and a final newline in the
22
source code.
33

4-
### Example: EnforcedStyle: final_blank_line
5-
# `final_blank_line` looks for one blank line followed by a new line
6-
# at the end of files.
4+
### Example: EnforcedStyle: final_newline (default)
5+
# `final_newline` looks for one newline at the end of files.
76

87
# bad
98
class Foo; end
9+
1010
# EOF
1111

1212
# bad
1313
class Foo; end # EOF
1414

1515
# good
1616
class Foo; end
17-
1817
# EOF
1918

20-
### Example: EnforcedStyle: final_newline (default)
21-
# `final_newline` looks for one newline at the end of files.
19+
### Example: EnforcedStyle: final_blank_line
20+
# `final_blank_line` looks for one blank line followed by a new line
21+
# at the end of files.
2222

2323
# bad
2424
class Foo; end
25-
2625
# EOF
2726

2827
# bad
2928
class Foo; end # EOF
3029

3130
# good
3231
class Foo; end
32+
3333
# EOF

config/contents/naming/variable_number.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,6 @@ Additionally, `CheckMethodNames` and `CheckSymbols` configuration options
66
can be used to specify whether method names and symbols should be checked.
77
Both are enabled by default.
88

9-
### Example: EnforcedStyle: snake_case
10-
# bad
11-
:some_sym1
12-
variable1 = 1
13-
14-
def some_method1; end
15-
16-
def some_method_1(arg1); end
17-
18-
# good
19-
:some_sym_1
20-
variable_1 = 1
21-
22-
def some_method_1; end
23-
24-
def some_method_1(arg_1); end
25-
269
### Example: EnforcedStyle: normalcase (default)
2710
# bad
2811
:some_sym_1
@@ -40,6 +23,23 @@ Both are enabled by default.
4023

4124
def some_method1(arg1); end
4225

26+
### Example: EnforcedStyle: snake_case
27+
# bad
28+
:some_sym1
29+
variable1 = 1
30+
31+
def some_method1; end
32+
33+
def some_method_1(arg1); end
34+
35+
# good
36+
:some_sym_1
37+
variable_1 = 1
38+
39+
def some_method_1; end
40+
41+
def some_method_1(arg_1); end
42+
4343
### Example: EnforcedStyle: non_integer
4444
# bad
4545
:some_sym1

0 commit comments

Comments
 (0)