From 1333d804129ca51c0e23822568ee5301d0888a41 Mon Sep 17 00:00:00 2001 From: Alex Popov Date: Tue, 14 Oct 2025 19:18:54 +0700 Subject: [PATCH 1/5] fix: Update docstring formatting for Service class parameters --- py/selenium/webdriver/chrome/service.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/py/selenium/webdriver/chrome/service.py b/py/selenium/webdriver/chrome/service.py index 683783c0f2db8..8e9bd9c8c0e31 100644 --- a/py/selenium/webdriver/chrome/service.py +++ b/py/selenium/webdriver/chrome/service.py @@ -27,11 +27,17 @@ class Service(service.ChromiumService): """A Service class that is responsible for the starting and stopping of `chromedriver`. - :param executable_path: install path of the chromedriver executable, defaults to `chromedriver`. - :param port: Port for the service to run on, defaults to 0 where the operating system will decide. - :param service_args: (Optional) Sequence of args to be passed to the subprocess when launching the executable. - :param log_output: (Optional) int representation of STDOUT/DEVNULL, any IO instance or String path to file. - :param env: (Optional) Mapping of environment variables for the new process, defaults to `os.environ`. + Args: + executable_path: Install path of the chromedriver executable, defaults + to `chromedriver`. + port: Port for the service to run on, defaults to 0 where the operating + system will decide. + service_args: (Optional) Sequence of args to be passed to the subprocess + when launching the executable. + log_output: (Optional) int representation of STDOUT/DEVNULL, any IO + instance or String path to file. + env: (Optional) Mapping of environment variables for the new process, + defaults to `os.environ`. """ def __init__( From 0cfeb0d3f27ba736ee69716496fd418fe39c2275 Mon Sep 17 00:00:00 2001 From: Alex Popov Date: Tue, 14 Oct 2025 19:20:21 +0700 Subject: [PATCH 2/5] fix: Update docstring formatting for ChromiumService parameters --- py/selenium/webdriver/chromium/service.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/py/selenium/webdriver/chromium/service.py b/py/selenium/webdriver/chromium/service.py index 80c79c56ca993..bb50c412ff37f 100644 --- a/py/selenium/webdriver/chromium/service.py +++ b/py/selenium/webdriver/chromium/service.py @@ -27,12 +27,18 @@ class ChromiumService(service.Service): """A Service class that is responsible for the starting and stopping the WebDriver instance of the ChromiumDriver. - :param executable_path: install path of the executable. - :param port: Port for the service to run on, defaults to 0 where the operating system will decide. - :param service_args: (Optional) Sequence of args to be passed to the subprocess when launching the executable. - :param log_output: (Optional) int representation of STDOUT/DEVNULL, any IO instance or String path to file. - :param env: (Optional) Mapping of environment variables for the new process, defaults to `os.environ`. - :param driver_path_env_key: (Optional) Environment variable to use to get the path to the driver executable. + Args: + executable_path: Install path of the executable. + port: Port for the service to run on, defaults to 0 where the operating + system will decide. + service_args: (Optional) Sequence of args to be passed to the subprocess + when launching the executable. + log_output: (Optional) int representation of STDOUT/DEVNULL, any IO + instance or String path to file. + env: (Optional) Mapping of environment variables for the new process, + defaults to `os.environ`. + driver_path_env_key: (Optional) Environment variable to use to get the + path to the driver executable. """ def __init__( From 5dcfbbbb4b9ff115252fd8715dacf6fcf29ca039 Mon Sep 17 00:00:00 2001 From: Alex Popov Date: Tue, 14 Oct 2025 19:26:23 +0700 Subject: [PATCH 3/5] fix: Update docstring formatting for Service class parameters in WebKitWebDriver and WPEWebDriver --- py/selenium/webdriver/webkitgtk/service.py | 18 +++++++++++------- py/selenium/webdriver/wpewebkit/service.py | 18 +++++++++++------- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/py/selenium/webdriver/webkitgtk/service.py b/py/selenium/webdriver/webkitgtk/service.py index 3017ffd241da3..ec514fc0fc433 100644 --- a/py/selenium/webdriver/webkitgtk/service.py +++ b/py/selenium/webdriver/webkitgtk/service.py @@ -29,13 +29,17 @@ class Service(service.Service): """A Service class that is responsible for the starting and stopping of `WebKitWebDriver`. - :param executable_path: install path of the WebKitWebDriver executable, defaults to the first - `WebKitWebDriver` in `$PATH`. - :param port: Port for the service to run on, defaults to 0 where the operating system will decide. - :param service_args: (Optional) Sequence of args to be passed to the subprocess when launching the executable. - :param log_output: (Optional) File path for the file to be opened and passed as the subprocess - stdout/stderr handler. - :param env: (Optional) Mapping of environment variables for the new process, defaults to `os.environ`. + Args: + executable_path: Install path of the WebKitWebDriver executable, + defaults to the first `WebKitWebDriver` in `$PATH`. + port: Port for the service to run on, defaults to 0 where the + operating system will decide. + service_args: (Optional) Sequence of args to be passed to the + subprocess when launching the executable. + log_output: (Optional) File path for the file to be opened and passed + as the subprocess stdout/stderr handler. + env: (Optional) Mapping of environment variables for the new process, + defaults to `os.environ`. """ def __init__( diff --git a/py/selenium/webdriver/wpewebkit/service.py b/py/selenium/webdriver/wpewebkit/service.py index 2ad99e77a54a6..928eca35756f7 100644 --- a/py/selenium/webdriver/wpewebkit/service.py +++ b/py/selenium/webdriver/wpewebkit/service.py @@ -28,13 +28,17 @@ class Service(service.Service): """A Service class that is responsible for the starting and stopping of `WPEWebDriver`. - :param executable_path: install path of the WPEWebDriver executable, defaults to the first - `WPEWebDriver` in `$PATH`. - :param port: Port for the service to run on, defaults to 0 where the operating system will decide. - :param service_args: (Optional) Sequence of args to be passed to the subprocess when launching the executable. - :param log_output: (Optional) File path for the file to be opened and passed as the subprocess - stdout/stderr handler. - :param env: (Optional) Mapping of environment variables for the new process, defaults to `os.environ`. + Args: + executable_path: Install path of the WPEWebDriver executable, defaults + to the first `WPEWebDriver` in `$PATH`. + port: Port for the service to run on, defaults to 0 where the + operating system will decide. + service_args: (Optional) Sequence of args to be passed to the + subprocess when launching the executable. + log_output: (Optional) File path for the file to be opened and passed + as the subprocess stdout/stderr handler. + env: (Optional) Mapping of environment variables for the new process, + defaults to `os.environ`. """ def __init__( From bb066d538ae71727d188be8313f21c639c5bb647 Mon Sep 17 00:00:00 2001 From: Alex Popov Date: Tue, 14 Oct 2025 20:29:32 +0700 Subject: [PATCH 4/5] fix: Update Ruff linting configuration to include additional docstring checks and set pydocstyle convention to Google --- py/pyproject.toml | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/py/pyproject.toml b/py/pyproject.toml index 39b06b8fefd00..ee223b0c98ddb 100644 --- a/py/pyproject.toml +++ b/py/pyproject.toml @@ -144,9 +144,38 @@ respect-gitignore = true target-version = "py39" [tool.ruff.lint] -extend-select = ["E4", "E7", "E9", "F", "I", "E501", "RUF022", "TID252"] +extend-select = ["E4", "E7", "E9", "F", "I", "E501", "RUF022", "TID252", "D"] fixable = ["ALL"] +extend-ignore = [ +"D103", # Missing docstring in public function +"D102", # Missing docstring in public method +"D100", # Missing docstring in public module +"D205", # 1 blank line required between summary line and description +"D107", # Missing docstring in `__init__` +"D101", # Missing docstring in public class +"D104", # Missing docstring in public package +"D209", # Multi-line docstring closing quotes should be on a separate line +"D202", # No blank lines allowed after function docstring (found 1) +"D105", # Missing docstring in magic method +"D415", # First line should end with a period, question mark, or exclamation point +"D212", # Multi-line docstring summary should start at the first line +"D200", # One-line docstring should fit on one line +"D411", # Missing blank line before section ("Example") +"D301", # Use `r"""` if any backslashes in a docstring +"D412", # No blank lines allowed between a section header and its content ("Example") +"D410", # Missing blank line after section ("Example") +"D419", # Docstring is empty +"D417", # Missing argument descriptions in the docstring for `__init__`: `duration`, `source` +"D416" # Section name should end with a colon ("Returns") +] + +[tool.ruff.lint.per-file-ignores] +"*.py" = ["D"] + +[tool.ruff.lint.pydocstyle] +convention = "google" + [tool.ruff.format] docstring-code-format = true docstring-code-line-length = 120 From 41c7f20b7fe40e6616ac0224007653b18862b65b Mon Sep 17 00:00:00 2001 From: Alex Popov Date: Wed, 15 Oct 2025 03:23:07 +0700 Subject: [PATCH 5/5] fix: Update Ruff linting configuration by removing unnecessary docstring ignores and simplifying settings --- py/pyproject.toml | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/py/pyproject.toml b/py/pyproject.toml index ee223b0c98ddb..39b06b8fefd00 100644 --- a/py/pyproject.toml +++ b/py/pyproject.toml @@ -144,38 +144,9 @@ respect-gitignore = true target-version = "py39" [tool.ruff.lint] -extend-select = ["E4", "E7", "E9", "F", "I", "E501", "RUF022", "TID252", "D"] +extend-select = ["E4", "E7", "E9", "F", "I", "E501", "RUF022", "TID252"] fixable = ["ALL"] -extend-ignore = [ -"D103", # Missing docstring in public function -"D102", # Missing docstring in public method -"D100", # Missing docstring in public module -"D205", # 1 blank line required between summary line and description -"D107", # Missing docstring in `__init__` -"D101", # Missing docstring in public class -"D104", # Missing docstring in public package -"D209", # Multi-line docstring closing quotes should be on a separate line -"D202", # No blank lines allowed after function docstring (found 1) -"D105", # Missing docstring in magic method -"D415", # First line should end with a period, question mark, or exclamation point -"D212", # Multi-line docstring summary should start at the first line -"D200", # One-line docstring should fit on one line -"D411", # Missing blank line before section ("Example") -"D301", # Use `r"""` if any backslashes in a docstring -"D412", # No blank lines allowed between a section header and its content ("Example") -"D410", # Missing blank line after section ("Example") -"D419", # Docstring is empty -"D417", # Missing argument descriptions in the docstring for `__init__`: `duration`, `source` -"D416" # Section name should end with a colon ("Returns") -] - -[tool.ruff.lint.per-file-ignores] -"*.py" = ["D"] - -[tool.ruff.lint.pydocstyle] -convention = "google" - [tool.ruff.format] docstring-code-format = true docstring-code-line-length = 120