You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve IDE support for Ruby Selenium, especially with meta-programming
Enable type hints in IDEs like RubyMine
⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review
Type Checking Bypass The use of steep:ignore comments around the add_message_handler method may hide potential type-related issues. Consider if this is necessary or if the method can be refactored to comply with type checking.
Type Checking Bypass The use of steep:ignore comments around the initialize method may hide potential type-related issues. Consider if this is necessary or if the method can be refactored to comply with type checking.
Type Checking Bypass The use of steep:ignore comments around the new_window method may hide potential type-related issues. Consider if this is necessary or if the method can be refactored to comply with type checking.
Type Checking Bypass The use of steep:ignore comments around the call method may hide potential type-related issues. Consider if this is necessary or if the method can be refactored to comply with type checking.
Type Safety Concern The @options hash has been changed to use untyped keys and values. This may reduce type safety and make it harder to catch errors at compile-time. Consider using more specific types if possible.
Specify more precise types for the @options hash to improve type safety and clarity
Instead of using untyped for both keys and values in the @options hash, consider specifying more precise types if possible. This could improve type checking and code clarity.
Why: The suggestion to specify more precise types for the @options hash enhances type safety and code clarity, aligning with good coding practices. However, it assumes specific types without context from the PR, which may not be accurate.
7
Specify a more accurate return type for the execute method to improve type safety
Consider using a more specific return type for the execute method. If the method always returns a String, keep it as is. If it can return other types, consider using a union type or a more general type that accurately represents all possible return values.
Why: The suggestion to use a union type for the return value of the execute method could improve type safety if the method indeed returns multiple types. However, without context from the PR, it's speculative.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
Description
This PRs implements inline ignore comments for issues related to the steep checker and updates the types that were causing errors
Motivation and Context
To add full RBS support for Selenium and eventually allow us to add an RBS check on the pipeline.
The reference feature is #10943
The goal is also to be able to have no steep errors to start adding the right type on the classes that have untyped to have the right type enforces
Types of changes
Checklist
PR Type
Enhancement
Description
Changes walkthrough 📝
20 files
log_handler.rb
Add steep ignore comments for log handler methodrb/lib/selenium/webdriver/bidi/log_handler.rb
add_message_handlermethod.account.rb
Add steep ignore comments for account initializationrb/lib/selenium/webdriver/common/fedcm/account.rb
initializemethod.target_locator.rb
Add steep ignore comments for new window methodrb/lib/selenium/webdriver/common/target_locator.rb
new_windowmethod.common.rb
Add steep ignore comments for HTTP call methodrb/lib/selenium/webdriver/remote/http/common.rb
callmethod.bidi.rbs
Update add_callback method signature in BiDirb/sig/lib/selenium/webdriver/bidi.rbs
add_callbackmethod signature to include event parameter.log_handler.rbs
Update log handler method signaturesrb/sig/lib/selenium/webdriver/bidi/log_handler.rbs
add_message_handlerblock parameter optional.remove_message_handler.struct.rbs
Specify untyped arguments for Struct classrb/sig/lib/selenium/webdriver/bidi/struct.rbs
Structclass to use untyped arguments.driver_finder.rbs
Add to_args method to driver finderrb/sig/lib/selenium/webdriver/common/driver_finder.rbs
to_argsmethod definition.error.rbs
Allow optional keys in URLS hashrb/sig/lib/selenium/webdriver/common/error.rbs
URLShash to allow optional keys.logger.rbs
Make block parameters optional in logger methodsrb/sig/lib/selenium/webdriver/common/logger.rbs
deprecateanddiscard_or_logmethods.
options.rbs
Use untyped keys and values for options hashrb/sig/lib/selenium/webdriver/common/options.rbs
@optionshash to use untyped keys and values.selenium_manager.rbs
Update binary_paths method to accept variable argumentsrb/sig/lib/selenium/webdriver/common/selenium_manager.rbs
binary_pathsmethod to accept variable string arguments.service.rbs
Add DRIVER_PATH_ENV_KEY constantrb/sig/lib/selenium/webdriver/common/service.rbs
DRIVER_PATH_ENV_KEYconstant.websocket_connection.rbs
Update add_callback method with block parameterrb/sig/lib/selenium/webdriver/common/websocket_connection.rbs
add_callbackmethod to include block parameter.account.rbs
Change initialize method to accept string argumentsrb/sig/lib/selenium/webdriver/fedcm/account.rbs
initializemethod to accept string arguments.options.rbs
Update options hash and enable_android parametersrb/sig/lib/selenium/webdriver/firefox/options.rbs
@optionshash to use untyped keys and values.enable_androidmethod parameters.bidi_bridge.rbs
Update close method return typerb/sig/lib/selenium/webdriver/remote/bidi_bridge.rbs
closemethod return type to untyped.bridge.rbs
Update method signatures in remote bridgerb/sig/lib/selenium/webdriver/remote/bridge.rbs
fedcm_account_listmethod return type.select_fedcm_accountmethod to accept an index parameter.executemethod return type to string.response.rbs
Change code attribute type to integerrb/sig/lib/selenium/webdriver/remote/response.rbs
@codeattribute type to integer.script.rbs
Update script initialization and handler methodsrb/sig/selenium/web_driver/script.rbs
initializemethod to useRemote::BiDiBridge.1 files
struct.rb
Update comment for clarity in BiDi modulerb/lib/selenium/webdriver/bidi/struct.rb