Skip to content

Commit bde7f06

Browse files
authored
[py] Fix Ruff D417 warnings in docstrings (#16535)
1 parent 9b24abb commit bde7f06

File tree

7 files changed

+17
-4
lines changed

7 files changed

+17
-4
lines changed

py/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ extend-ignore = [
158158
"D205", # 1 blank line required between summary line and description
159159
"D212", # Multi-line docstring summary should start at the first line
160160
"D415", # First line should end with a period, question mark, or exclamation point
161-
"D417", # Missing argument descriptions in the docstring for `__init__`
162161
]
163162

164163
[tool.ruff.format]

py/selenium/webdriver/common/action_chains.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ def __init__(self, driver: WebDriver, duration: int = 250, devices: list[AnyDevi
7272
Args:
7373
driver: The WebDriver instance which performs user actions.
7474
duration: override the default 250 msecs of DEFAULT_MOVE_DURATION in PointerInput
75+
devices: Optional list of input devices (PointerInput, KeyInput, WheelInput) to use.
76+
If not provided, default devices will be created.
7577
"""
7678
self._driver = driver
7779
mouse = None

py/selenium/webdriver/common/actions/pointer_actions.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@
2525

2626
class PointerActions(Interaction):
2727
def __init__(self, source: Optional[PointerInput] = None, duration: int = 250):
28-
"""
28+
"""Initialize a new PointerActions instance.
29+
2930
Args:
30-
- source: PointerInput instance
31-
- duration: override the default 250 msecs of DEFAULT_MOVE_DURATION in source
31+
source: Optional PointerInput instance. If not provided, a default
32+
mouse PointerInput will be created.
33+
duration: Override the default 250 msecs of DEFAULT_MOVE_DURATION
34+
in the source.
3235
"""
3336
if source is None:
3437
source = PointerInput(interaction.POINTER_MOUSE, "mouse")

py/selenium/webdriver/ie/service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def __init__(
4848
log_output: (Optional) int representation of STDOUT/DEVNULL, any IO instance or String path to file.
4949
Default is "stdout".
5050
driver_path_env_key: (Optional) Environment variable to use to get the path to the driver executable.
51+
**kwargs: Additional keyword arguments to pass to the parent Service class.
5152
"""
5253
self._service_args = list(service_args or [])
5354
driver_path_env_key = driver_path_env_key or "SE_IEDRIVER"

py/selenium/webdriver/remote/shadowroot.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def find_element(self, by: str = By.ID, value: str = None):
5959
- By.LINK_TEXT: Locate a link element by its exact text.
6060
- By.PARTIAL_LINK_TEXT: Locate a link element by partial text match.
6161
- RelativeBy: Locate elements relative to a specified root element.
62+
value: The locator value to use with the specified `by` strategy.
6263
6364
Returns:
6465
The first matching `WebElement` found on the page.
@@ -94,6 +95,7 @@ def find_elements(self, by: str = By.ID, value: str = None) -> list:
9495
- By.LINK_TEXT: Locate a link element by its exact text.
9596
- By.PARTIAL_LINK_TEXT: Locate a link element by partial text match.
9697
- RelativeBy: Locate elements relative to a specified root element.
98+
value: The locator value to use with the specified `by` strategy.
9799
98100
Returns:
99101
List of `WebElements` matching locator strategy found on the page.

py/selenium/webdriver/remote/webdriver.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,7 @@ def find_element(self, by=By.ID, value: Optional[str] = None) -> WebElement:
822822
values include: By.ID, By.NAME, By.XPATH, By.CSS_SELECTOR,
823823
By.CLASS_NAME, By.TAG_NAME, By.LINK_TEXT, By.PARTIAL_LINK_TEXT,
824824
or RelativeBy.
825+
value: The locator value to use with the specified `by` strategy.
825826
826827
Returns:
827828
The first matching WebElement found on the page.
@@ -847,6 +848,7 @@ def find_elements(self, by=By.ID, value: Optional[str] = None) -> list[WebElemen
847848
values include: By.ID, By.NAME, By.XPATH, By.CSS_SELECTOR,
848849
By.CLASS_NAME, By.TAG_NAME, By.LINK_TEXT, By.PARTIAL_LINK_TEXT,
849850
or RelativeBy.
851+
value: The locator value to use with the specified `by` strategy.
850852
851853
Returns:
852854
List of WebElements matching locator strategy found on the page.
@@ -943,6 +945,7 @@ def set_window_size(self, width, height, windowHandle: str = "current") -> None:
943945
Args:
944946
width: The width in pixels to set the window to.
945947
height: The height in pixels to set the window to.
948+
windowHandle: The handle of the window to resize. Default is "current".
946949
947950
Example:
948951
>>> driver.set_window_size(800, 600)
@@ -970,6 +973,7 @@ def set_window_position(self, x: float, y: float, windowHandle: str = "current")
970973
Args:
971974
x: The x-coordinate in pixels to set the window position.
972975
y: The y-coordinate in pixels to set the window position.
976+
windowHandle: The handle of the window to reposition. Default is "current".
973977
974978
Example:
975979
>>> driver.set_window_position(0, 0)

py/selenium/webdriver/remote/webelement.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ def find_element(self, by=By.ID, value=None) -> WebElement:
524524
- By.LINK_TEXT: Locate a link element by its exact text.
525525
- By.PARTIAL_LINK_TEXT: Locate a link element by partial text match.
526526
- RelativeBy: Locate elements relative to a specified root element.
527+
value: The locator value to use with the specified `by` strategy.
527528
528529
Returns:
529530
The first matching `WebElement` found on the page.
@@ -548,6 +549,7 @@ def find_elements(self, by=By.ID, value=None) -> list[WebElement]:
548549
- By.LINK_TEXT: Locate a link element by its exact text.
549550
- By.PARTIAL_LINK_TEXT: Locate a link element by partial text match.
550551
- RelativeBy: Locate elements relative to a specified root element.
552+
value: The locator value to use with the specified `by` strategy.
551553
552554
Returns:
553555
List of `WebElements` matching locator strategy found on the page.

0 commit comments

Comments
 (0)