Skip to content

Commit 56d7d82

Browse files
authored
Update rubocop to 1.29.0 (#314)
- General bundle update. - Update the docs too.
1 parent e89041b commit 56d7d82

24 files changed

+142
-29
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.28.1", require: false
9+
gem "rubocop", "1.29.0", require: false
1010
gem "rubocop-i18n", require: false
1111
gem "rubocop-graphql", require: false
1212
gem "rubocop-minitest", require: false

Gemfile.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
activesupport (7.0.2.3)
4+
activesupport (7.0.3)
55
concurrent-ruby (~> 1.0, >= 1.0.2)
66
i18n (>= 1.6, < 2)
77
minitest (>= 5.1)
@@ -25,7 +25,7 @@ GEM
2525
rack (2.2.3)
2626
rainbow (3.1.1)
2727
rake (13.0.6)
28-
regexp_parser (2.3.0)
28+
regexp_parser (2.3.1)
2929
rexml (3.2.5)
3030
rspec (3.11.0)
3131
rspec-core (~> 3.11.0)
@@ -40,12 +40,12 @@ GEM
4040
diff-lcs (>= 1.2.0, < 2.0)
4141
rspec-support (~> 3.11.0)
4242
rspec-support (3.11.0)
43-
rubocop (1.28.1)
43+
rubocop (1.29.0)
4444
parallel (~> 1.10)
4545
parser (>= 3.1.0.0)
4646
rainbow (>= 2.2.2, < 4.0)
4747
regexp_parser (>= 1.8, < 3.0)
48-
rexml
48+
rexml (>= 3.2.5, < 4.0)
4949
rubocop-ast (>= 1.17.0, < 2.0)
5050
ruby-progressbar (~> 1.7)
5151
unicode-display_width (>= 1.4.0, < 3.0)
@@ -72,13 +72,13 @@ GEM
7272
rubocop (~> 1.0)
7373
rubocop-shopify (2.5.0)
7474
rubocop (~> 1.25)
75-
rubocop-sorbet (0.6.7)
75+
rubocop-sorbet (0.6.8)
7676
rubocop (>= 0.90.0)
7777
rubocop-thread_safety (0.4.4)
7878
rubocop (>= 0.53.0)
7979
ruby-progressbar (1.11.0)
8080
safe_yaml (1.0.5)
81-
test-prof (1.0.8)
81+
test-prof (1.0.9)
8282
tzinfo (2.0.4)
8383
concurrent-ruby (~> 1.0)
8484
unicode-display_width (2.1.0)
@@ -93,7 +93,7 @@ DEPENDENCIES
9393
pry
9494
rake
9595
rspec
96-
rubocop (= 1.28.1)
96+
rubocop (= 1.29.0)
9797
rubocop-graphql
9898
rubocop-i18n
9999
rubocop-minitest
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
Enforce that gem dependency version specifications or a commit reference (branch,
2+
ref, or tag) are either required or forbidden.
3+
4+
### Example: EnforcedStyle: required (default)
5+
6+
# bad
7+
Gem::Specification.new do |spec|
8+
spec.add_dependency 'parser'
9+
end
10+
11+
# bad
12+
Gem::Specification.new do |spec|
13+
spec.add_development_dependency 'parser'
14+
end
15+
16+
# good
17+
Gem::Specification.new do |spec|
18+
spec.add_dependency 'parser', '>= 2.3.3.1', '< 3.0'
19+
end
20+
21+
# good
22+
Gem::Specification.new do |spec|
23+
spec.add_development_dependency 'parser', '>= 2.3.3.1', '< 3.0'
24+
end
25+
26+
### Example: EnforcedStyle: forbidden
27+
28+
# bad
29+
Gem::Specification.new do |spec|
30+
spec.add_dependency 'parser', '>= 2.3.3.1', '< 3.0'
31+
end
32+
33+
# bad
34+
Gem::Specification.new do |spec|
35+
spec.add_development_dependency 'parser', '>= 2.3.3.1', '< 3.0'
36+
end
37+
38+
# good
39+
Gem::Specification.new do |spec|
40+
spec.add_dependency 'parser'
41+
end
42+
43+
# good
44+
Gem::Specification.new do |spec|
45+
spec.add_development_dependency 'parser'
46+
end

config/contents/gemspec/ruby_version_globals_usage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ to execute `rake release` and not user's ruby version.
88

99
# bad
1010
Gem::Specification.new do |spec|
11-
if RUBY_VERSION >= '2.5'
11+
if RUBY_VERSION >= '3.0'
1212
spec.add_runtime_dependency 'gem_a'
1313
else
1414
spec.add_runtime_dependency 'gem_b'

config/contents/lint/ambiguous_range.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
This cop checks for ambiguous ranges.
22

3-
Ranges have quite low precedence, which leads to unexpected behaviour when
3+
Ranges have quite low precedence, which leads to unexpected behavior when
44
using a range with other operators. This cop avoids that by making ranges
55
explicit by requiring parenthesis around complex range boundaries (anything
66
that is not a literal: numerics, strings, symbols, etc.).
@@ -17,7 +17,7 @@ value, it will be wrapped in order to prevent the ambiguity of `1..2.to_a`.
1717
The cop auto-corrects by wrapping the entire boundary in parentheses, which
1818
makes the outcome more explicit but is possible to not be the intention of the
1919
programmer. For this reason, this cop's auto-correct is unsafe (it will not
20-
change the behaviour of the code, but will not necessarily match the
20+
change the behavior of the code, but will not necessarily match the
2121
intent of the program).
2222

2323
### Example:

config/contents/lint/loop.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ This cop checks for uses of `begin...end while/until something`.
22

33
### Safety:
44

5-
The cop is unsafe because behaviour can change in some cases, including
5+
The cop is unsafe because behavior can change in some cases, including
66
if a local variable inside the loop body is accessed outside of it, or if the
77
loop body raises a `StopIteration` exception (which `Kernel#loop` rescues).
88

config/contents/lint/non_deterministic_require_order.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ NOTE: This cop will be deprecated and removed when supporting only Ruby 3.0 and
1414
### Safety:
1515

1616
This cop is unsafe in the case where sorting files changes existing
17-
expected behaviour.
17+
expected behavior.
1818

1919
### Example:
2020

config/contents/lint/or_assignment_to_constant.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ locations, the result may vary depending on the order of `require`.
77
### Safety:
88

99
This cop is unsafe because code that is already conditionally
10-
assigning a constant may have its behaviour changed by
10+
assigning a constant may have its behavior changed by
1111
auto-correction.
1212

1313
### Example:

config/contents/lint/raise_exception.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ name with an explicit namespace.
1111
### Safety:
1212

1313
This cop is unsafe because it will change the exception class being
14-
raised, which is a change in behaviour.
14+
raised, which is a change in behavior.
1515

1616
### Example:
1717
# bad

config/contents/naming/variable_name.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,8 @@ snake_case or camelCase, for their names.
1313
foo_bar = 1
1414

1515
# good
16-
fooBar = 1
16+
fooBar = 1
17+
18+
### Example: AllowedPatterns: ['_v\d+\z']
19+
# good
20+
:release_v1

0 commit comments

Comments
 (0)