- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 8.6k
 
[py] Fix Ruff D417 warnings in docstrings #16535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[py] Fix Ruff D417 warnings in docstrings #16535
Conversation
…dow_position methods
| 
           @cgoldberg check please  | 
    
          PR Compliance Guide 🔍(Compliance updated until commit 7727420)Below is a summary of compliance checks for this PR: 
 Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label Previous compliance checksCompliance check up to commit 7727420
  | 
    ||||||||||||||||||||||||||||||||||||||||||||
          PR Code Suggestions ✨Explore these optional code suggestions: 
  | 
    ||||||||||||||
| 
           Just in case, I'll run tests in my pipeline ⏳  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
User description
🔗 Related Issues
relates #16432 and #11442
💥 What does this PR do?
This pull request improves the clarity and completeness of docstrings across several Selenium WebDriver classes and methods. The main focus is on documenting the purpose and usage of parameters, especially the
valueparameter in element locator methods, and providing clearer explanations for device and window management arguments.Docstring improvements for element location methods:
valueparameter infind_elementandfind_elementsmethods inWebDriver,WebElement, andShadowRootclasses, clarifying its role in locator strategies. [1] [2] [3] [4] [5] [6]Enhancements to window management method docstrings:
set_window_sizeandset_window_positionmethods inWebDriverto document thewindowHandleparameter and its default value. [1] [2]Device and service initialization docstring updates:
ActionChainsandPointerActionsclass docstrings to clarify the optionaldevicesandsourceparameters and their default behaviors. [1] [2]Serviceclass for IE driver to document the**kwargsparameter for additional customization.Linting configuration adjustment:
D417rule from theextend-ignoresection inpyproject.toml, allowing enforcement of argument descriptions in__init__docstrings.🔧 Implementation Notes
💡 Additional Considerations
🔄 Types of changes
PR Type
Documentation
Description
Add missing parameter documentation to docstrings across multiple files
Document
valueparameter in element locator methods (find_element, find_elements)Document
devicesandsourceparameters in ActionChains and PointerActionsDocument
windowHandleparameter in window management methodsEnable D417 Ruff rule enforcement for missing argument descriptions in init
Diagram Walkthrough
File Walkthrough
action_chains.py
Document optional devices parameter in ActionChainspy/selenium/webdriver/common/action_chains.py
devicesparameter in ActionChainsconstructor
not provided
pointer_actions.py
Enhance PointerActions constructor docstring claritypy/selenium/webdriver/common/actions/pointer_actions.py
sourceparameter as optional with default behaviorservice.py
Document kwargs parameter in IE Servicepy/selenium/webdriver/ie/service.py
**kwargsparameter in Service constructorService class
shadowroot.py
Document value parameter in ShadowRoot locatorspy/selenium/webdriver/remote/shadowroot.py
valueparameter documentation to find_element methodvalueparameter documentation to find_elements methodbystrategywebdriver.py
Document value and windowHandle parameters in WebDriverpy/selenium/webdriver/remote/webdriver.py
valueparameter documentation to find_element methodvalueparameter documentation to find_elements methodwindowHandleparameter documentation to set_window_size methodwindowHandleparameter documentation to set_window_positionmethod
webelement.py
Document value parameter in WebElement locatorspy/selenium/webdriver/remote/webelement.py
valueparameter documentation to find_element methodvalueparameter documentation to find_elements methodbystrategypyproject.toml
Enable D417 Ruff rule enforcementpy/pyproject.toml
D417rule from theextend-ignorelist in Ruff configuration__init__docstrings