Skip to content

Commit 4428c25

Browse files
authored
[py] Fix ruff D415 warnings in docstrings (#16536)
1 parent bde7f06 commit 4428c25

File tree

8 files changed

+210
-268
lines changed

8 files changed

+210
-268
lines changed

py/pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ target-version = "py39"
146146
[tool.ruff.lint]
147147
extend-select = ["D", "E4", "E7", "E9", "F", "I", "E501", "RUF022", "TID252"]
148148
fixable = ["ALL"]
149-
# remove these as we cleanup docstrings
150149
extend-ignore = [
151150
"D100", # Missing docstring in public module
152151
"D101", # Missing docstring in public class
@@ -157,7 +156,6 @@ extend-ignore = [
157156
"D107", # Missing docstring in `__init__`
158157
"D205", # 1 blank line required between summary line and description
159158
"D212", # Multi-line docstring summary should start at the first line
160-
"D415", # First line should end with a period, question mark, or exclamation point
161159
]
162160

163161
[tool.ruff.format]

py/selenium/webdriver/chromium/webdriver.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def set_network_conditions(self, **network_conditions) -> None:
105105
upload_throughput=500 * 1024,
106106
) # maximal throughput
107107
108-
Note: 'throughput' can be used to set both (for download and upload).
108+
Note: `throughput` can be used to set both (for download and upload).
109109
"""
110110
self.execute("setNetworkConditions", {"network_conditions": network_conditions})
111111

@@ -126,17 +126,19 @@ def set_permissions(self, name: str, value: str) -> None:
126126
self.execute("setPermissions", {"descriptor": {"name": name}, "state": value})
127127

128128
def execute_cdp_cmd(self, cmd: str, cmd_args: dict):
129-
"""Execute Chrome Devtools Protocol command and get returned result The
130-
command and command args should follow chrome devtools protocol
131-
domains/commands, refer to link
132-
https://chromedevtools.github.io/devtools-protocol/
129+
"""Execute Chrome Devtools Protocol command and get returned result.
130+
131+
The command and command args should follow chrome devtools protocol domains/commands
132+
133+
See:
134+
- https://chromedevtools.github.io/devtools-protocol/
133135
134136
Args:
135137
cmd: A str, command name
136138
cmd_args: A dict, command args. empty dict {} if there is no command args
137139
138140
Example:
139-
driver.execute_cdp_cmd('Network.getResponseBody', {'requestId': requestId})
141+
`driver.execute_cdp_cmd('Network.getResponseBody', {'requestId': requestId})`
140142
141143
Returns:
142144
A dict, empty dict {} if there is no result to return.

py/selenium/webdriver/common/options.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ def __set__(self, obj, value):
6565

6666

6767
class _PageLoadStrategyDescriptor:
68-
"""Determines the point at which a navigation command is returned:
69-
https://w3c.github.io/webdriver/#dfn-table-of-page-load-strategies.
68+
"""Determines the point at which a navigation command is returned.
69+
70+
See:
71+
- https://w3c.github.io/webdriver/#dfn-table-of-page-load-strategies.
7072
7173
Args:
7274
strategy: the strategy corresponding to a document readiness state
@@ -86,9 +88,10 @@ def __set__(self, obj, value):
8688

8789

8890
class _UnHandledPromptBehaviorDescriptor:
89-
"""How the driver should respond when an alert is present and the:
90-
command sent is not handling the alert:
91-
https://w3c.github.io/webdriver/#dfn-table-of-page-load-strategies:
91+
"""How the driver should respond when an alert is present and the command sent is not handling the alert.
92+
93+
See:
94+
- https://w3c.github.io/webdriver/#dfn-table-of-page-load-strategies:
9295
9396
Args:
9497
behavior: behavior to use when an alert is encountered
@@ -114,8 +117,10 @@ def __set__(self, obj, value):
114117

115118

116119
class _TimeoutsDescriptor:
117-
"""How long the driver should wait for actions to complete before:
118-
returning an error https://w3c.github.io/webdriver/#timeouts:
120+
"""How long the driver should wait for actions to complete before returning an error.
121+
122+
See:
123+
- https://w3c.github.io/webdriver/#timeouts
119124
120125
Args:
121126
timeouts: values in milliseconds for implicit wait, page load and script timeout

0 commit comments

Comments
 (0)