Skip to content

Commit 275e903

Browse files
authored
Merge pull request #338 from ruby-i18n/dependabot/bundler/rubocop-shopify-2.18.0
Bump rubocop-shopify from 2.17.0 to 2.18.0
2 parents 18ae873 + c00bd7c commit 275e903

File tree

7 files changed

+47
-47
lines changed

7 files changed

+47
-47
lines changed

Gemfile.lock

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ GEM
4545
rake
4646
rdoc
4747
semver2
48-
json (2.10.2)
48+
json (2.16.0)
4949
jwt (2.9.3)
5050
base64
5151
language_server-protocol (3.17.0.5)
@@ -78,7 +78,7 @@ GEM
7878
multi_xml (~> 0.5)
7979
rack (>= 1.2, < 3)
8080
parallel (1.27.0)
81-
parser (3.3.8.0)
81+
parser (3.3.10.0)
8282
ast (~> 2.4.1)
8383
racc
8484
power_assert (2.0.5)
@@ -100,24 +100,24 @@ GEM
100100
rchardet (1.8.0)
101101
rdoc (6.10.0)
102102
psych (>= 4.0.0)
103-
regexp_parser (2.10.0)
103+
regexp_parser (2.11.3)
104104
reline (0.6.0)
105105
io-console (~> 0.5)
106-
rubocop (1.75.2)
106+
rubocop (1.81.7)
107107
json (~> 2.3)
108108
language_server-protocol (~> 3.17.0.2)
109109
lint_roller (~> 1.1.0)
110110
parallel (~> 1.10)
111111
parser (>= 3.3.0.2)
112112
rainbow (>= 2.2.2, < 4.0)
113113
regexp_parser (>= 2.9.3, < 3.0)
114-
rubocop-ast (>= 1.44.0, < 2.0)
114+
rubocop-ast (>= 1.47.1, < 2.0)
115115
ruby-progressbar (~> 1.7)
116116
unicode-display_width (>= 2.4.0, < 4.0)
117-
rubocop-ast (1.44.1)
117+
rubocop-ast (1.48.0)
118118
parser (>= 3.3.7.2)
119119
prism (~> 1.4)
120-
rubocop-shopify (2.17.0)
120+
rubocop-shopify (2.18.0)
121121
rubocop (~> 1.62)
122122
ruby-lsp (0.26.2)
123123
language_server-protocol (~> 3.17.0)
@@ -131,9 +131,9 @@ GEM
131131
power_assert
132132
thor (1.4.0)
133133
thread_safe (0.3.6)
134-
unicode-display_width (3.1.4)
135-
unicode-emoji (~> 4.0, >= 4.0.4)
136-
unicode-emoji (4.0.4)
134+
unicode-display_width (3.2.0)
135+
unicode-emoji (~> 4.1)
136+
unicode-emoji (4.1.0)
137137

138138
PLATFORMS
139139
aarch64-linux

lib/cldr/export/data/currencies.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def currency(node)
3030
end
3131

3232
symbols = select(node, "symbol")
33-
narrow_symbol = symbols.select { |child_node| child_node.attribute("alt")&.value == ("narrow") }.first
33+
narrow_symbol = symbols.select { |child_node| child_node.attribute("alt")&.value == "narrow" }.first
3434
data[:narrow_symbol] = narrow_symbol.content unless narrow_symbol.nil?
3535

3636
symbol = symbols.select { |child_node| child_node.attribute("alt").nil? }.first

lib/cldr/export/data/plurals/rules.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def parse_list(str)
5151
ranges = []
5252
str.split(",").each do |value|
5353
parts = value.split("..")
54-
if parts.count == 1
54+
if parts.one?
5555
values << value.to_i
5656
else
5757
ranges << (parts.first.to_i..parts.last.to_i)
@@ -75,7 +75,7 @@ def parse(code)
7575
code.split(/and/i).inject(Proposition.new("&&")) { |rule, code| rule << parse(code) }
7676
when /^\s*#{expr}\s+(?:is(\s+not)?|(not\s+)?in|(!)?=)\s+#{range_list}\s*$/i
7777
list = parse_list(Regexp.last_match(6))
78-
Expression.new(list.first.count == 1 && list.last.count == 0 ? :is : :in, Regexp.last_match(2), !(Regexp.last_match(3).nil? && Regexp.last_match(4).nil? && Regexp.last_match(5).nil?), list.first.count == 1 && list.last.count == 0 ? list.first.first : list, Regexp.last_match(1))
78+
Expression.new(list.first.one? && list.last.none? ? :is : :in, Regexp.last_match(2), !(Regexp.last_match(3).nil? && Regexp.last_match(4).nil? && Regexp.last_match(5).nil?), list.first.one? && list.last.none? ? list.first.first : list, Regexp.last_match(1))
7979
when /^\s*#{expr}\s+(not\s+)?within\s+#{range_list}\s*$/i
8080
Expression.new(:within, Regexp.last_match(2), !Regexp.last_match(3).nil?, parse_list(Regexp.last_match(4)).last.first, Regexp.last_match(1))
8181
when /^\s*$/
@@ -203,14 +203,14 @@ def to_ruby
203203
str = ""
204204
bop = op
205205
bop = "(#{bop})" if enclose || @mod
206-
if values.count == 1
206+
if values.one?
207207
str = "#{bop} #{@negate ? "!=" : "=="} #{values.first}"
208208
elsif values.count > 1
209209
str = prepend + "#{values.inspect}.include?(#{op})"
210210
end
211-
enclose = ranges.count > 1 || (values.count > 0 && ranges.count > 0)
212-
if ranges.count > 0
213-
str += " || " if values.count > 0
211+
enclose = ranges.count > 1 || (values.any? && ranges.any?)
212+
if ranges.any?
213+
str += " || " if values.any?
214214
str += "((#{bop} % 1).zero? && " if fraction
215215

216216
ranges_formatted = ranges.map do |range|

lib/cldr/export/deep_validate_keys.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def validate(hash, component, key_path = [])
77
hash.each do |key, value|
88
full_path = key_path + [key]
99
raise ArgumentError, "Invalid key: #{full_path} in #{component}" unless key.to_s == key.to_s.underscore ||
10-
SNAKE_CASE_EXCEPTIONS.fetch(component, []).any? { |exception| paths_match(exception, full_path) }
10+
SNAKE_CASE_EXCEPTIONS.fetch(component, []).any? { |exception| paths_match?(exception, full_path) }
1111

1212
validate(value, component, full_path) if value.is_a?(Hash)
1313
end
@@ -46,7 +46,7 @@ def validate(hash, component, key_path = [])
4646
],
4747
}
4848

49-
def paths_match(pattern, key)
49+
def paths_match?(pattern, key)
5050
raise NotImplementedError, "Multiple * in pattern is unsupported" if pattern.count { |element| element == "*" } > 1
5151

5252
pattern_index = 0

lib/cldr/locale/fallbacks.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def [](locale)
1010
loop do
1111
if defined_parents[ancestry.last]
1212
ancestry << defined_parents[ancestry.last]
13-
elsif I18n::Locale::Tag.tag(ancestry.last).parents.count > 0
13+
elsif I18n::Locale::Tag.tag(ancestry.last).parents.any?
1414
ancestry << I18n::Locale::Tag.tag(ancestry.last).parents.first.to_sym
1515
else
1616
break

test/export/deep_validate_keys_test.rb

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,44 +5,44 @@
55
require File.expand_path(File.join(File.dirname(__FILE__) + "/../../lib/cldr/export/deep_validate_keys"))
66

77
class TestDeepValidateKeys < Test::Unit::TestCase
8-
test "#paths_match with empty pattern matches only empty key" do
9-
assert DeepValidateKeys.send(:paths_match, [], [])
10-
refute DeepValidateKeys.send(:paths_match, [], ["foo", "bar", "baz", "qux"])
8+
test "#paths_match? with empty pattern matches only empty key" do
9+
assert DeepValidateKeys.send(:"paths_match?", [], [])
10+
refute DeepValidateKeys.send(:"paths_match?", [], ["foo", "bar", "baz", "qux"])
1111
end
1212

13-
test "#paths_match matches with exact match" do
14-
assert DeepValidateKeys.send(:paths_match, ["foo", "bar"], ["foo", "bar"])
13+
test "#paths_match? matches with exact match" do
14+
assert DeepValidateKeys.send(:"paths_match?", ["foo", "bar"], ["foo", "bar"])
1515

16-
refute DeepValidateKeys.send(:paths_match, ["foo"], ["foo", "bar", "baz", "qux"])
17-
refute DeepValidateKeys.send(:paths_match, ["foo"], ["bar", "baz", "qux"])
18-
refute DeepValidateKeys.send(:paths_match, ["foo", "bar"], ["foo"])
19-
refute DeepValidateKeys.send(:paths_match, ["foo", "baz"], ["foo", "bar", "baz", "qux"])
16+
refute DeepValidateKeys.send(:"paths_match?", ["foo"], ["foo", "bar", "baz", "qux"])
17+
refute DeepValidateKeys.send(:"paths_match?", ["foo"], ["bar", "baz", "qux"])
18+
refute DeepValidateKeys.send(:"paths_match?", ["foo", "bar"], ["foo"])
19+
refute DeepValidateKeys.send(:"paths_match?", ["foo", "baz"], ["foo", "bar", "baz", "qux"])
2020
end
2121

22-
test "#paths_match with . matches single element" do
23-
assert DeepValidateKeys.send(:paths_match, ["foo", ".", "baz"], ["foo", "bar", "baz"])
24-
assert DeepValidateKeys.send(:paths_match, ["foo", ".", ".", "qux"], ["foo", "bar", "baz", "qux"])
25-
assert DeepValidateKeys.send(:paths_match, ["."], ["foo"])
26-
assert DeepValidateKeys.send(:paths_match, [".", "bar"], ["foo", "bar"])
22+
test "#paths_match? with . matches single element" do
23+
assert DeepValidateKeys.send(:"paths_match?", ["foo", ".", "baz"], ["foo", "bar", "baz"])
24+
assert DeepValidateKeys.send(:"paths_match?", ["foo", ".", ".", "qux"], ["foo", "bar", "baz", "qux"])
25+
assert DeepValidateKeys.send(:"paths_match?", ["."], ["foo"])
26+
assert DeepValidateKeys.send(:"paths_match?", [".", "bar"], ["foo", "bar"])
2727

28-
refute DeepValidateKeys.send(:paths_match, ["."], [])
28+
refute DeepValidateKeys.send(:"paths_match?", ["."], [])
2929
end
3030

31-
test "#paths_match with trailing * matches anything after the star" do
32-
assert DeepValidateKeys.send(:paths_match, ["foo", "*"], ["foo", "bar", "baz", "qux"])
33-
assert DeepValidateKeys.send(:paths_match, ["*"], [])
34-
assert DeepValidateKeys.send(:paths_match, ["*"], ["foo", "bar", "baz", "qux"])
31+
test "#paths_match? with trailing * matches anything after the star" do
32+
assert DeepValidateKeys.send(:"paths_match?", ["foo", "*"], ["foo", "bar", "baz", "qux"])
33+
assert DeepValidateKeys.send(:"paths_match?", ["*"], [])
34+
assert DeepValidateKeys.send(:"paths_match?", ["*"], ["foo", "bar", "baz", "qux"])
3535
end
3636

37-
test "#paths_match with * greedy matches up to the last match of the next element" do
38-
assert DeepValidateKeys.send(:paths_match, ["foo", "*", "baz", "quxx"], ["foo", "bar", "baz", "qux", "baz", "quxx"])
37+
test "#paths_match? with * greedy matches up to the last match of the next element" do
38+
assert DeepValidateKeys.send(:"paths_match?", ["foo", "*", "baz", "quxx"], ["foo", "bar", "baz", "qux", "baz", "quxx"])
3939

40-
refute DeepValidateKeys.send(:paths_match, ["foo", "*", "baz", "quxx"], ["foo", "bar", "baz", "qux"])
40+
refute DeepValidateKeys.send(:"paths_match?", ["foo", "*", "baz", "quxx"], ["foo", "bar", "baz", "qux"])
4141
end
4242

43-
test "#paths_match raise when given a pattern with multiple *" do
43+
test "#paths_match? raise when given a pattern with multiple *" do
4444
exc = assert_raises(NotImplementedError) do
45-
DeepValidateKeys.send(:paths_match, ["foo", "*", "baz", "*"], ["foo", "bar", "baz", "qux", "baz", "quxx"])
45+
DeepValidateKeys.send(:"paths_match?", ["foo", "*", "baz", "*"], ["foo", "bar", "baz", "qux", "baz", "quxx"])
4646
end
4747
assert_equal "Multiple * in pattern is unsupported", exc.message
4848
end

test/test_autotest.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ def tests_for(filename)
2121
require "test/unit"
2222

2323
class TestAutotestMatching < Test::Unit::TestCase
24-
define_method :"test: default mapping for library files" do
24+
define_method test_default_mapping_for_library_files do
2525
assert tests_for("lib/cldr/format/date.rb").all? { |file| file =~ /date_test.rb/ }
2626
assert tests_for("lib/cldr/format/decimal/fraction.rb").all? { |file| file =~ /fraction_test.rb/ }
2727
assert tests_for("lib/cldr/format/decimal/base.rb").all? { |file| file =~ /decimal/ }
2828
end
2929

30-
define_method :"test: mapping for gregorian.rb" do
30+
define_method test_mapping_for_gregorian_rb do
3131
assert_equal ["test/export/data/calendars_test.rb"], tests_for("lib/cldr/calendars/gregorian.rb")
3232
end
3333

34-
define_method :"test: default mapping for test files" do
34+
define_method test_default_mapping_for_test_files do
3535
assert_equal ["test/export_test.rb"], tests_for("test/export_test.rb")
3636
end
3737
end

0 commit comments

Comments
 (0)