Skip to content

Commit a14b659

Browse files
authored
[rb] Reduce RBS errors to 0 (#14661)
1 parent 62aa0e5 commit a14b659

File tree

23 files changed

+55
-64
lines changed

23 files changed

+55
-64
lines changed

rb/Gemfile.lock

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ PATH
1313
GEM
1414
remote: https://rubygems.org/
1515
specs:
16-
activesupport (7.2.1.2)
16+
activesupport (7.2.2)
1717
base64
18+
benchmark (>= 0.3)
1819
bigdecimal
1920
concurrent-ruby (~> 1.0, >= 1.3.1)
2021
connection_pool (>= 2.2.5)
@@ -28,6 +29,7 @@ GEM
2829
public_suffix (>= 2.0.2, < 7.0)
2930
ast (2.4.2)
3031
base64 (0.2.0)
32+
benchmark (0.4.0)
3133
bigdecimal (3.1.8)
3234
bigdecimal (3.1.8-java)
3335
concurrent-ruby (1.3.4)
@@ -45,7 +47,7 @@ GEM
4547
ffi (1.17.0)
4648
ffi (1.17.0-java)
4749
ffi (1.17.0-x86_64-darwin)
48-
fileutils (1.7.2)
50+
fileutils (1.7.3)
4951
git (1.19.1)
5052
addressable (~> 2.8)
5153
rchardet (~> 1.8)
@@ -58,21 +60,21 @@ GEM
5860
rdoc (>= 4.0.0)
5961
reline (>= 0.4.2)
6062
jar-dependencies (0.4.1)
61-
json (2.7.5)
62-
json (2.7.5-java)
63+
json (2.8.1)
64+
json (2.8.1-java)
6365
language_server-protocol (3.17.0.3)
6466
listen (3.9.0)
6567
rb-fsevent (~> 0.10, >= 0.10.3)
6668
rb-inotify (~> 0.9, >= 0.9.10)
6769
logger (1.6.1)
6870
minitest (5.25.1)
6971
parallel (1.26.3)
70-
parser (3.3.5.0)
72+
parser (3.3.6.0)
7173
ast (~> 2.4.1)
7274
racc
73-
psych (5.1.2)
75+
psych (5.2.0)
7476
stringio
75-
psych (5.1.2-java)
77+
psych (5.2.0-java)
7678
jar-dependencies (>= 0.1.7)
7779
public_suffix (6.0.1)
7880
racc (1.8.1)
@@ -89,7 +91,7 @@ GEM
8991
rdoc (6.7.0)
9092
psych (>= 4.0.0)
9193
regexp_parser (2.9.2)
92-
reline (0.5.10)
94+
reline (0.5.11)
9395
io-console (~> 0.5)
9496
rexml (3.3.9)
9597
rspec (3.13.0)
@@ -105,7 +107,7 @@ GEM
105107
diff-lcs (>= 1.2.0, < 2.0)
106108
rspec-support (~> 3.13.0)
107109
rspec-support (3.13.1)
108-
rubocop (1.67.0)
110+
rubocop (1.68.0)
109111
json (~> 2.3)
110112
language_server-protocol (>= 3.17.0)
111113
parallel (~> 1.10)
@@ -115,7 +117,7 @@ GEM
115117
rubocop-ast (>= 1.32.2, < 2.0)
116118
ruby-progressbar (~> 1.7)
117119
unicode-display_width (>= 2.4.0, < 3.0)
118-
rubocop-ast (1.33.0)
120+
rubocop-ast (1.34.1)
119121
parser (>= 3.3.1.0)
120122
rubocop-capybara (2.21.0)
121123
rubocop (~> 1.41)
@@ -151,7 +153,7 @@ GEM
151153
securerandom (>= 0.1)
152154
strscan (>= 1.0.0)
153155
terminal-table (>= 2, < 4)
154-
stringio (3.1.1)
156+
stringio (3.1.2)
155157
strscan (3.1.0)
156158
strscan (3.1.0-java)
157159
terminal-table (3.0.2)
@@ -163,7 +165,7 @@ GEM
163165
addressable (>= 2.8.0)
164166
crack (>= 0.3.2)
165167
hashdiff (>= 0.4.0, < 2.0.0)
166-
webrick (1.8.2)
168+
webrick (1.9.0)
167169
websocket (1.2.11)
168170
yard (0.9.37)
169171

rb/lib/selenium/webdriver/bidi/log_handler.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def initialize(bidi)
3030
end
3131

3232
# @return [int] id of the handler
33+
# steep:ignore:start
3334
def add_message_handler(type)
3435
subscribe_log_entry unless @log_entry_subscribed
3536
@bidi.add_callback('log.entryAdded') do |params|
@@ -39,6 +40,7 @@ def add_message_handler(type)
3940
end
4041
end
4142
end
43+
# steep:ignore:end
4244

4345
# @param [int] id of the handler previously added
4446
def remove_message_handler(id)

rb/lib/selenium/webdriver/bidi/struct.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ def camel_to_snake(camel_str)
3737
end
3838
end
3939
end
40-
end
41-
42-
# BiDi
40+
end # BiDi
4341
end # WebDriver
4442
end # Selenium

rb/lib/selenium/webdriver/common/error.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ def initialize(msg = '')
5050
super(URLS[class_name] ? "#{msg}; #{SUPPORT_MSG} #{URLS[class_name]}" : msg)
5151
end
5252

53+
# steep:ignore:start
5354
def class_name
54-
self.class.name&.split('::')&.last&.to_sym
55+
self.class.name.split('::')&.last&.to_sym
5556
end
57+
# steep:ignore:end
5658
end
5759

5860
#

rb/lib/selenium/webdriver/common/fedcm/account.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ class Account
3030
attr_reader :account_id, :email, :name, :given_name, :picture_url,
3131
:idp_config_url, :login_state, :terms_of_service_url, :privacy_policy_url
3232

33-
# Initializes a new account with the provided attributes.
34-
#
35-
# @param [Hash]
33+
# steep:ignore:start
3634
def initialize(**args)
3735
@account_id = args['accountId']
3836
@email = args['email']
@@ -44,6 +42,7 @@ def initialize(**args)
4442
@terms_of_service_url = args['termsOfServiceUrl']
4543
@privacy_policy_url = args['privacyPolicyUrl']
4644
end
45+
# steep:ignore:end
4746
end # Account
4847
end # FedCM
4948
end # WebDriver

rb/lib/selenium/webdriver/common/target_locator.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def parent_frame
5050
# @param type either :tab or :window
5151
#
5252

53+
# steep:ignore:start
5354
def new_window(type = :window)
5455
raise ArgumentError, "Valid types are :tab and :window, received: #{type.inspect}" unless %i[window
5556
tab].include?(type)
@@ -70,6 +71,7 @@ def new_window(type = :window)
7071
window(handle)
7172
end
7273
end
74+
# steep:ignore:end
7375

7476
#
7577
# switch to the given window handle

rb/lib/selenium/webdriver/remote/http/common.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def close
4848
# hook for subclasses - will be called on Driver#quit
4949
end
5050

51+
# steep:ignore:start
5152
def call(verb, url, command_hash)
5253
url = server_url.merge(url) unless url.is_a?(URI)
5354
headers = common_headers.dup
@@ -66,6 +67,7 @@ def call(verb, url, command_hash)
6667

6768
request verb, url, headers, payload
6869
end
70+
# steep:ignore:end
6971

7072
private
7173

rb/sig/lib/selenium/webdriver/bidi.rbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Selenium
77

88
def initialize: (url: String) -> void
99

10-
def add_callback: -> Integer
10+
def add_callback: (String event) { () -> void } -> Integer
1111

1212
def close: () -> nil
1313

rb/sig/lib/selenium/webdriver/bidi/log_handler.rbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ module Selenium
1212

1313
def initialize: (BiDi bidi) -> void
1414

15-
def add_message_handler: (String type) { (untyped) -> untyped } -> Integer
15+
def add_message_handler: (String type) ?{ (untyped) -> untyped } -> Integer
1616

17-
def remove_message_handler: (Integer id) -> bool
17+
def remove_message_handler: (Integer id) -> bool?
1818

1919
private
2020

rb/sig/lib/selenium/webdriver/bidi/struct.rbs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module Selenium
22
module WebDriver
33
class BiDi
4-
class Struct < ::Struct
5-
def self.new: (*untyped args) { (?) -> untyped } -> void
4+
class Struct < ::Struct[untyped]
5+
def self.new: (*untyped args) ?{ (self) [self: self] -> untyped } -> void
66

77
def self.camel_to_snake: (String camel_str) -> String
88
end

0 commit comments

Comments
 (0)