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
This file contains 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
This is a bunch of small fixes to docstrings that sphinx keeps complaining about when generating the Python docs. There are still a ton of warnings when building the docs, but this at least fixes some of them.
This also includes some minor changes suggested by the bot below in comments.
Types of changes
Bug fix (non-breaking change which fixes an issue)
New feature (non-breaking change which adds functionality)
Breaking change (fix or feature that would cause existing functionality to change)
The formatting for the Usage and Parameters sections in the script timeout docstring is inconsistent with other sections. The plus signs are missing before the section headers.
The socks_username property docstring incorrectly states it "Gets and Sets socks_password" instead of "socks_username".
"""Gets and Sets `socks_password`Usage:------- Get - `self.socks_password`- Set - `self.socks_password` = `value`Parameters:-----------`value`: `str`"""
The return type in the docstring for web_socket_url getter is incorrectly specified as bool when it should be str or None to match the parameter type and actual implementation.
web_socket_url = _BaseOptionsDescriptor("webSocketUrl")
"""Gets and Sets WebSocket URL.
Usage:
------
- Get
- `self.web_socket_url`
- Set
- `self.web_socket_url` = `value`
Parameters:
-----------
`value`: `str`
Returns:
--------
- Get
- - `bool`+ - `str` or `None`
- Set
+ - `None`
"""
[To ensure code accuracy, apply this suggestion manually]
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly identifies a documentation error where the return type for the web_socket_url getter is incorrectly specified as 'bool' when it should be 'str' or 'None' to match the parameter type. This is an important fix for API documentation accuracy.
web_socket_url = _BaseOptionsDescriptor("webSocketUrl")
-"""Gets and Set whether the session accepts insecure certificates.+"""Gets and Sets WebSocket URL.
[Suggestion has been applied]
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly identifies a significant error in the docstring where the WebSocket URL property is incorrectly described as controlling insecure certificates acceptance. This is a clear documentation bug that could mislead developers.
Medium
✅ Fix incorrect parameter typeSuggestion Impact:The commit changed the parameter type in the documentation from bool to str as suggested. It also fixed the description of the web_socket_url property.
code diff:
- """Gets and Set whether the session accepts insecure certificates.+ """Gets and Sets WebSocket URL.
Usage:
------
@@ -430,7 +430,7 @@
Parameters:
-----------
- `value`: `bool`+ `value`: `str`
The parameter and return type for web_socket_url are incorrectly documented as bool when they should be str based on the property name and its usage.
web_socket_url = _BaseOptionsDescriptor("webSocketUrl")
"""Gets and Sets WebSocket URL.
Usage:
------
- Get
- `self.web_socket_url`
- Set
- `self.web_socket_url` = `value`
Parameters:
-----------
-`value`: `bool`+`value`: `str`
Returns:
--------
- Get
- - `bool`+ - `str`
- Set
- `None`
"""
Suggestion importance[1-10]: 7
__
Why: The suggestion correctly identifies that the parameter and return types for web_socket_url are incorrectly documented as boolean when they should be strings. This is an important documentation fix that prevents confusion about the expected data types.
Medium
Possible issue
✅ Remove duplicate property declarationSuggestion Impact:The commit removed the first instance of the web_socket_url property declaration (lines 5-25 in the diff), which was one of the duplicates identified in the suggestion. The suggestion wanted to remove the second instance, but the commit removed the first one instead, achieving the same goal of eliminating the duplication.
The web_socket_url property is duplicated in the BaseOptions class. There are two identical property declarations at lines 287 and 421, which could cause confusion or unexpected behavior.
-web_socket_url = _BaseOptionsDescriptor("webSocketUrl")-"""Gets and Sets WebSocket URL.+# Remove the duplicate declaration, keeping only one instance of web_socket_url-Usage:--------- Get- - `self.web_socket_url`-- Set- - `self.web_socket_url` = `value`--Parameters:-------------`value`: `bool`--Returns:----------- Get- - `bool`-- Set- - `None`-"""-
[Suggestion has been applied]
Suggestion importance[1-10]: 9
__
Why: The suggestion correctly identifies a duplicate declaration of the web_socket_url property in the BaseOptions class. This duplication (at lines 287-305 and 421-440) could lead to unexpected behavior as the second declaration would override the first one. Removing the duplicate is critical for proper class functionality.
✅ Fix inconsistent docstring formattingSuggestion Impact:The commit implemented the exact change suggested, adding one more dash to the 'Example:' section underline to make it consistent with the 'Parameters:' section
code diff:
- -------+ --------
The indentation in the docstring is inconsistent. The "Example:" section has one less dash than the "Parameters:" section, which could cause issues with Sphinx documentation generation.
def set_page_load_timeout(self, time_to_wait: float) -> None:
"""Sets the amount of time to wait for a page load to complete before
throwing an error.
Parameters:
-----------
time_to_wait : float
- The amount of time to wait (in seconds)
Example:
- -------+ --------
>>> driver.set_page_load_timeout(30)
"""
Suggestion importance[1-10]: 5
__
Why: The suggestion correctly identifies an inconsistency in the docstring formatting where the "Example:" section uses 7 dashes (-------) while the "Parameters:" section uses 9 dashes (-----------). This inconsistency could affect documentation generation with tools like Sphinx.
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
Motivation and Context
This is a bunch of small fixes to docstrings that sphinx keeps complaining about when generating the Python docs. There are still a ton of warnings when building the docs, but this at least fixes some of them.
This also includes some minor changes suggested by the bot below in comments.
Types of changes
Checklist
PR Type
Documentation
Description
Fixed inconsistent docstring formatting across multiple files.
Standardized section headers in docstrings for better Sphinx compatibility.
Improved clarity and consistency in parameter and return descriptions.
Changes walkthrough 📝
15 files
Standardized docstring headers for methods.
Fixed docstring formatting for class attributes.
Standardized docstring headers and usage examples.
Improved docstring formatting for print options.
Fixed docstring formatting for proxy settings.
Standardized docstring headers for timeout descriptors.
Standardized docstring headers for IE options.
Fixed docstring formatting for shadow root methods.
Standardized docstring headers for WebDriver methods.
Improved docstring formatting for WebElement methods.
Standardized docstring headers for Safari options.
Fixed docstring formatting for expected conditions.
Standardized docstring headers for relative locator methods.
Improved docstring formatting for wait methods.
Fixed minor formatting issue in documentation index.