Skip to content

Commit c263849

Browse files
authored
Updated channel and documentation to Rubocop v1.7.0 (#267)
Bumps the 'rubocop' dependency to v1.70.0 as well as some subdependencies, updates the scraped documentation, and fixes several specs. See #267 for additional details.
1 parent aa7f42c commit c263849

File tree

83 files changed

+1385
-104
lines changed

Some content is hidden

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

83 files changed

+1385
-104
lines changed

Gemfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@ gem "activesupport", require: false
66
gem "mry", require: false
77
gem "parser"
88
gem "pry", require: false
9-
gem "rubocop", "0.92.0", require: false
9+
gem "rubocop", "1.7.0", require: false
1010
gem "rubocop-i18n", require: false
11-
gem "rubocop-migrations", require: false
1211
gem "rubocop-minitest", require: false
1312
gem "rubocop-performance", require: false
1413
gem "rubocop-rails", require: false
1514
gem "rubocop-rake", require: false
1615
gem "rubocop-rspec", require: false
1716
gem "rubocop-sequel", require: false
18-
gem 'rubocop-sorbet', require: false
17+
gem "rubocop-sorbet", require: false
1918
gem "rubocop-thread_safety", require: false
2019
gem "safe_yaml"
2120
gem "test-prof", require: false

Gemfile.lock

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ GEM
1717
minitest (5.14.1)
1818
mry (0.78.0.0)
1919
rubocop (>= 0.41.0)
20-
parallel (1.19.2)
21-
parser (2.7.1.5)
20+
parallel (1.20.1)
21+
parser (3.0.0.0)
2222
ast (~> 2.4.1)
2323
pry (0.13.1)
2424
coderay (~> 1.1)
2525
method_source (~> 1.0)
2626
rack (2.2.3)
2727
rainbow (3.0.0)
2828
rake (13.0.1)
29-
regexp_parser (1.8.1)
29+
regexp_parser (2.0.3)
3030
rexml (3.2.4)
3131
rspec (3.9.0)
3232
rspec-core (~> 3.9.0)
@@ -41,21 +41,19 @@ GEM
4141
diff-lcs (>= 1.2.0, < 2.0)
4242
rspec-support (~> 3.9.0)
4343
rspec-support (3.9.3)
44-
rubocop (0.92.0)
44+
rubocop (1.7.0)
4545
parallel (~> 1.10)
4646
parser (>= 2.7.1.5)
4747
rainbow (>= 2.2.2, < 4.0)
48-
regexp_parser (>= 1.7)
48+
regexp_parser (>= 1.8, < 3.0)
4949
rexml
50-
rubocop-ast (>= 0.5.0)
50+
rubocop-ast (>= 1.2.0, < 2.0)
5151
ruby-progressbar (~> 1.7)
5252
unicode-display_width (>= 1.4.0, < 2.0)
53-
rubocop-ast (0.7.1)
53+
rubocop-ast (1.4.0)
5454
parser (>= 2.7.1.5)
55-
rubocop-i18n (2.0.2)
56-
rubocop (~> 0.51)
57-
rubocop-migrations (0.1.2)
58-
rubocop (~> 0.41)
55+
rubocop-i18n (3.0.0)
56+
rubocop (~> 1.0)
5957
rubocop-minitest (0.9.0)
6058
rubocop (>= 0.74)
6159
rubocop-performance (1.7.0)
@@ -68,13 +66,13 @@ GEM
6866
rubocop
6967
rubocop-rspec (1.41.0)
7068
rubocop (>= 0.68.1)
71-
rubocop-sequel (0.0.6)
72-
rubocop (~> 0.55, >= 0.55)
69+
rubocop-sequel (0.1.0)
70+
rubocop (~> 1.0)
7371
rubocop-sorbet (0.5.1)
7472
rubocop
7573
rubocop-thread_safety (0.4.1)
7674
rubocop (>= 0.51.0)
77-
ruby-progressbar (1.10.1)
75+
ruby-progressbar (1.11.0)
7876
safe_yaml (1.0.5)
7977
test-prof (0.11.3)
8078
thread_safe (0.3.6)
@@ -93,9 +91,8 @@ DEPENDENCIES
9391
pry
9492
rake
9593
rspec
96-
rubocop (= 0.92.0)
94+
rubocop (= 1.7.0)
9795
rubocop-i18n
98-
rubocop-migrations
9996
rubocop-minitest
10097
rubocop-performance
10198
rubocop-rails

config/contents/bundler/duplicated_gem.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,13 @@ A Gem's requirements should be listed only once in a Gemfile.
1919
end
2020

2121
# good
22-
gem 'rubocop', groups: [:development, :test]
22+
gem 'rubocop', groups: [:development, :test]
23+
24+
# good - conditional declaration
25+
if Dir.exist?(local)
26+
gem 'rubocop', path: local
27+
elsif ENV['RUBOCOP_VERSION'] == 'master'
28+
gem 'rubocop', git: 'https://github.com/rubocop-hq/rubocop.git'
29+
else
30+
gem 'rubocop', '~> 0.90.0'
31+
end

config/contents/gemspec/required_ruby_version.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@ required by gemspec.
3131
spec.required_ruby_version = '>= 2.5'
3232
end
3333

34-
# good
34+
# accepted but not recommended
3535
Gem::Specification.new do |spec|
3636
spec.required_ruby_version = ['>= 2.5.0', '< 2.7.0']
3737
end
3838

39-
# good
39+
# accepted but not recommended, since
40+
# Ruby does not really follow semantic versionning
4041
Gem::Specification.new do |spec|
4142
spec.required_ruby_version = '~> 2.5'
4243
end

config/contents/layout/else_alignment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
This cop checks the alignment of else keywords. Normally they should
2-
be aligned with an if/unless/while/until/begin/def keyword, but there
2+
be aligned with an if/unless/while/until/begin/def/rescue keyword, but there
33
are special cases when they should follow the same rules as the
44
alignment of end.
55

config/contents/layout/empty_line_between_defs.md

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
This cop checks whether method definitions are
2-
separated by one empty line.
1+
This cop checks whether class/module/method definitions are
2+
separated by one or more empty lines.
33

44
`NumberOfEmptyLines` can be an integer (default is 1) or
55
an array (e.g. [1, 2]) to specify a minimum and maximum
66
number of empty lines permitted.
77

88
`AllowAdjacentOneLineDefs` configures whether adjacent
9-
one-line method definitions are considered an offense.
9+
one-line definitions are considered an offense.
1010

11-
### Example:
11+
### Example: EmptyLineBetweenMethodDefs: true (default)
12+
# checks for empty lines between method definitions.
1213

1314
# bad
1415
def a
@@ -23,4 +24,57 @@ one-line method definitions are considered an offense.
2324
end
2425

2526
def b
26-
end
27+
end
28+
29+
### Example: EmptyLineBetweenClassDefs: true (default)
30+
# checks for empty lines between class definitions.
31+
32+
# bad
33+
class A
34+
end
35+
class B
36+
end
37+
def b
38+
end
39+
40+
### Example:
41+
42+
# good
43+
class A
44+
end
45+
46+
class B
47+
end
48+
49+
def b
50+
end
51+
52+
### Example: EmptyLineBetweenModuleDefs: true (default)
53+
# checks for empty lines between module definitions.
54+
55+
# bad
56+
module A
57+
end
58+
module B
59+
end
60+
def b
61+
end
62+
63+
### Example:
64+
65+
# good
66+
module A
67+
end
68+
69+
module B
70+
end
71+
72+
def b
73+
end
74+
75+
### Example: AllowAdjacentOneLineDefs: true
76+
77+
# good
78+
class ErrorA < BaseError; end
79+
class ErrorB < BaseError; end
80+
class ErrorC < BaseError; end

config/contents/layout/space_around_operators.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
Checks that operators have space around them, except for ** which
22
should or shouldn't have surrounding space depending on configuration.
3+
It allows vertical alignment consisting of one or more whitespace
4+
around operators.
35

46
This cop has `AllowForAlignment` option. When `true`, allows most
57
uses of extra spacing if the intent is to align with an operator on
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Checks for space between the name of a receiver and a left
2+
brackets.
3+
4+
This cop is marked as unsafe because it can occur false positives
5+
for `do_something [this_is_an_array_literal_argument]` that take
6+
an array without parentheses as an argument.
7+
8+
### Example:
9+
10+
# bad
11+
collection [index_or_key]
12+
13+
# good
14+
collection[index_or_key]

config/contents/layout/space_inside_parens.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@ Checks for spaces inside ordinary round parentheses.
66
# bad
77
f( 3)
88
g = (a + 3 )
9+
f( )
910

1011
# good
1112
f(3)
1213
g = (a + 3)
14+
f()
1315

1416
### Example: EnforcedStyle: space
1517
# The `space` style enforces that parentheses have a space at the

config/contents/layout/trailing_whitespace.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,25 @@ This cop looks for trailing whitespace in the source code.
99
# good
1010
x = 0
1111

12-
### Example: AllowInHeredoc: false
12+
### Example: AllowInHeredoc: false (default)
1313
# The line in this example contains spaces after the 0.
1414
# bad
1515
code = <<~RUBY
1616
x = 0
1717
RUBY
1818

19-
### Example: AllowInHeredoc: true (default)
19+
# ok
20+
code = <<~RUBY
21+
x = 0 #{}
22+
RUBY
23+
24+
# good
25+
trailing_whitespace = ' '
26+
code = <<~RUBY
27+
x = 0#{trailing_whitespace}
28+
RUBY
29+
30+
### Example: AllowInHeredoc: true
2031
# The line in this example contains spaces after the 0.
2132
# good
2233
code = <<~RUBY

0 commit comments

Comments
 (0)