Skip to content

Commit 6b72ca2

Browse files
authored
Update rubocop to 1.46.0 (#340)
- General bundle update. - Update the docs too.
1 parent d70508f commit 6b72ca2

Some content is hidden

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

41 files changed

+833
-80
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"
77
gem "pry", require: false
8-
gem "rubocop", "1.40.0", require: false
8+
gem "rubocop", "1.46.0", require: false
99
gem "rubocop-i18n", require: false
1010
gem "rubocop-graphql", require: false
1111
gem "rubocop-minitest", require: false

Gemfile.lock

+32-29
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,89 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
activesupport (7.0.4)
4+
activesupport (7.0.4.2)
55
concurrent-ruby (~> 1.0, >= 1.0.2)
66
i18n (>= 1.6, < 2)
77
minitest (>= 5.1)
88
tzinfo (~> 2.0)
99
ast (2.4.2)
1010
coderay (1.1.3)
11-
concurrent-ruby (1.1.10)
11+
concurrent-ruby (1.2.2)
1212
diff-lcs (1.5.0)
1313
i18n (1.12.0)
1414
concurrent-ruby (~> 1.0)
1515
json (2.6.3)
1616
method_source (1.0.0)
17-
minitest (5.16.3)
17+
minitest (5.17.0)
1818
parallel (1.22.1)
19-
parser (3.1.3.0)
19+
parser (3.2.1.0)
2020
ast (~> 2.4.1)
21-
pry (0.14.1)
21+
pry (0.14.2)
2222
coderay (~> 1.1)
2323
method_source (~> 1.0)
24-
rack (3.0.2)
24+
rack (3.0.4.1)
2525
rainbow (3.1.1)
2626
rake (13.0.6)
27-
regexp_parser (2.6.1)
27+
regexp_parser (2.7.0)
2828
rexml (3.2.5)
2929
rspec (3.12.0)
3030
rspec-core (~> 3.12.0)
3131
rspec-expectations (~> 3.12.0)
3232
rspec-mocks (~> 3.12.0)
33-
rspec-core (3.12.0)
33+
rspec-core (3.12.1)
3434
rspec-support (~> 3.12.0)
35-
rspec-expectations (3.12.0)
35+
rspec-expectations (3.12.2)
3636
diff-lcs (>= 1.2.0, < 2.0)
3737
rspec-support (~> 3.12.0)
38-
rspec-mocks (3.12.1)
38+
rspec-mocks (3.12.3)
3939
diff-lcs (>= 1.2.0, < 2.0)
4040
rspec-support (~> 3.12.0)
4141
rspec-support (3.12.0)
42-
rubocop (1.40.0)
42+
rubocop (1.46.0)
4343
json (~> 2.3)
4444
parallel (~> 1.10)
45-
parser (>= 3.1.2.1)
45+
parser (>= 3.2.0.0)
4646
rainbow (>= 2.2.2, < 4.0)
4747
regexp_parser (>= 1.8, < 3.0)
4848
rexml (>= 3.2.5, < 4.0)
49-
rubocop-ast (>= 1.23.0, < 2.0)
49+
rubocop-ast (>= 1.26.0, < 2.0)
5050
ruby-progressbar (~> 1.7)
51-
unicode-display_width (>= 1.4.0, < 3.0)
52-
rubocop-ast (1.24.0)
53-
parser (>= 3.1.1.0)
54-
rubocop-graphql (0.18.0)
51+
unicode-display_width (>= 2.4.0, < 3.0)
52+
rubocop-ast (1.27.0)
53+
parser (>= 3.2.1.0)
54+
rubocop-capybara (2.17.1)
55+
rubocop (~> 1.41)
56+
rubocop-graphql (1.0.0)
5557
rubocop (>= 0.87, < 2)
5658
rubocop-i18n (3.0.0)
5759
rubocop (~> 1.0)
58-
rubocop-minitest (0.25.0)
59-
rubocop (>= 0.90, < 2.0)
60-
rubocop-performance (1.15.1)
60+
rubocop-minitest (0.28.0)
61+
rubocop (>= 1.39, < 2.0)
62+
rubocop-performance (1.16.0)
6163
rubocop (>= 1.7.0, < 2.0)
6264
rubocop-ast (>= 0.4.0)
63-
rubocop-rails (2.17.3)
65+
rubocop-rails (2.18.0)
6466
activesupport (>= 4.2.0)
6567
rack (>= 1.1)
6668
rubocop (>= 1.33.0, < 2.0)
6769
rubocop-rake (0.6.0)
6870
rubocop (~> 1.0)
69-
rubocop-rspec (2.16.0)
71+
rubocop-rspec (2.18.1)
7072
rubocop (~> 1.33)
73+
rubocop-capybara (~> 2.17)
7174
rubocop-sequel (0.3.4)
7275
rubocop (~> 1.0)
73-
rubocop-shopify (2.10.1)
74-
rubocop (~> 1.35)
75-
rubocop-sorbet (0.6.11)
76+
rubocop-shopify (2.12.0)
77+
rubocop (~> 1.44)
78+
rubocop-sorbet (0.7.0)
7679
rubocop (>= 0.90.0)
7780
rubocop-thread_safety (0.4.4)
7881
rubocop (>= 0.53.0)
7982
ruby-progressbar (1.11.0)
80-
test-prof (1.1.0)
81-
tzinfo (2.0.5)
83+
test-prof (1.2.0)
84+
tzinfo (2.0.6)
8285
concurrent-ruby (~> 1.0)
83-
unicode-display_width (2.3.0)
86+
unicode-display_width (2.4.2)
8487

8588
PLATFORMS
8689
ruby
@@ -91,7 +94,7 @@ DEPENDENCIES
9194
pry
9295
rake
9396
rspec
94-
rubocop (= 1.40.0)
97+
rubocop (= 1.46.0)
9598
rubocop-graphql
9699
rubocop-i18n
97100
rubocop-minitest
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
Enforce that development dependencies for a gem are specified in
2+
`Gemfile`, rather than in the `gemspec` using
3+
`add_development_dependency`. Alternatively, using `EnforcedStyle:
4+
gemspec`, enforce that all dependencies are specified in `gemspec`,
5+
rather than in `Gemfile`.
6+
7+
### Example: EnforcedStyle: Gemfile (default)
8+
# Specify runtime dependencies in your gemspec,
9+
# but all other dependencies in your Gemfile.
10+
11+
# bad
12+
# example.gemspec
13+
s.add_development_dependency "foo"
14+
15+
# good
16+
# Gemfile
17+
gem "foo"
18+
19+
# good
20+
# gems.rb
21+
gem "foo"
22+
23+
# good (with AllowedGems: ["bar"])
24+
# example.gemspec
25+
s.add_development_dependency "bar"
26+
27+
### Example: EnforcedStyle: gems.rb
28+
# Specify runtime dependencies in your gemspec,
29+
# but all other dependencies in your Gemfile.
30+
#
31+
# Identical to `EnforcedStyle: Gemfile`, but with a different error message.
32+
# Rely on Bundler/GemFilename to enforce the use of `Gemfile` vs `gems.rb`.
33+
34+
# bad
35+
# example.gemspec
36+
s.add_development_dependency "foo"
37+
38+
# good
39+
# Gemfile
40+
gem "foo"
41+
42+
# good
43+
# gems.rb
44+
gem "foo"
45+
46+
# good (with AllowedGems: ["bar"])
47+
# example.gemspec
48+
s.add_development_dependency "bar"
49+
50+
### Example: EnforcedStyle: gemspec
51+
# Specify all dependencies in your gemspec.
52+
53+
# bad
54+
# Gemfile
55+
gem "foo"
56+
57+
# good
58+
# example.gemspec
59+
s.add_development_dependency "foo"
60+
61+
# good (with AllowedGems: ["bar"])
62+
# Gemfile
63+
gem "bar"

config/contents/layout/class_structure.md

-2
Original file line numberDiff line numberDiff line change
@@ -124,5 +124,3 @@ automatically.
124124
def some_private_method
125125
end
126126
end
127-
128-
@see https://rubystyle.guide#consistent-classes
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,46 @@
11
Checks for a line break before the first element in a
22
multi-line array.
33

4-
### Example:
4+
### Example: AllowMultilineFinalElement: false (default)
55

66
# bad
77
[ :a,
88
:b]
99

10+
# bad
11+
[ :a, {
12+
:b => :c
13+
}]
14+
15+
# good
16+
[:a, :b]
17+
1018
# good
1119
[
1220
:a,
1321
:b]
22+
23+
# good
24+
[
25+
:a, {
26+
:b => :c
27+
}]
28+
29+
### Example: AllowMultilineFinalElement: true
30+
31+
# bad
32+
[ :a,
33+
:b]
34+
35+
# good
36+
[ :a, {
37+
:b => :c
38+
}]
39+
40+
# good
41+
[
42+
:a,
43+
:b]
44+
45+
# good
46+
[:a, :b]
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,52 @@
11
Checks for a line break before the first element in a
22
multi-line hash.
33

4-
### Example:
4+
### Example: AllowMultilineFinalElement: false (default)
55

66
# bad
77
{ a: 1,
88
b: 2}
99

10+
# bad
11+
{ a: 1, b: {
12+
c: 3
13+
}}
14+
15+
# good
16+
{
17+
a: 1,
18+
b: 2 }
19+
20+
# good
21+
{
22+
a: 1, b: {
23+
c: 3
24+
}}
25+
26+
### Example: AllowMultilineFinalElement: true
27+
28+
# bad
29+
{ a: 1,
30+
b: 2}
31+
32+
# bad
33+
{ a: 1,
34+
b: {
35+
c: 3
36+
}}
37+
38+
# good
39+
{ a: 1, b: {
40+
c: 3
41+
}}
42+
1043
# good
1144
{
1245
a: 1,
13-
b: 2 }
46+
b: 2 }
47+
48+
# good
49+
{
50+
a: 1, b: {
51+
c: 3
52+
}}
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,70 @@
11
Checks for a line break before the first argument in a
22
multi-line method call.
33

4-
### Example:
4+
### Example: AllowMultilineFinalElement: false (default)
55

66
# bad
77
method(foo, bar,
88
baz)
99

10+
# bad
11+
method(foo, bar, {
12+
baz: "a",
13+
qux: "b",
14+
})
15+
1016
# good
1117
method(
1218
foo, bar,
1319
baz)
1420

21+
# good
22+
method(
23+
foo, bar, {
24+
baz: "a",
25+
qux: "b",
26+
})
27+
28+
# ignored
29+
method foo, bar,
30+
baz
31+
32+
### Example: AllowMultilineFinalElement: true
33+
34+
# bad
35+
method(foo, bar,
36+
baz)
37+
38+
# bad
39+
method(foo,
40+
bar,
41+
{
42+
baz: "a",
43+
qux: "b",
44+
}
45+
)
46+
47+
# good
48+
method(foo, bar, {
49+
baz: "a",
50+
qux: "b",
51+
})
52+
53+
# good
54+
method(
55+
foo, bar,
56+
baz)
57+
58+
# good
59+
method(
60+
foo,
61+
bar,
62+
{
63+
baz: "a",
64+
qux: "b",
65+
}
66+
)
67+
1568
# ignored
1669
method foo, bar,
1770
baz

0 commit comments

Comments
 (0)