Skip to content
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

[dotnet] Address warnings with ActionSequence.inputDevice #14848

Merged
merged 2 commits into from
Dec 6, 2024

Conversation

RenderMichael
Copy link
Contributor

@RenderMichael RenderMichael commented Dec 4, 2024

User description

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

Addresses CLS compliance and obsoletion warnings with ActionSequence.inputDevice

Motivation and Context

Having two members whose names differ only by case is not CLS-compliant, since some .NET languages are not case-sensitive. As such, we can mark the obsolete property as incompatible with CLS.

Likewise, we can replace usage of this property with the non-obsolete version.

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)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

PR Type

enhancement, bug fix


Description

  • Added [CLSCompliant(false)] attribute to the obsolete inputDevice property in ActionSequence.cs to address CLS compliance warnings.
  • Replaced the usage of the obsolete inputDevice property with the non-obsolete InputDevice property in Actions.cs.

Changes walkthrough 📝

Relevant files
Enhancement
ActionSequence.cs
Add CLS compliance attribute to obsolete property               

dotnet/src/webdriver/Interactions/ActionSequence.cs

  • Added CLS compliance attribute to the obsolete inputDevice property.
  • Marked inputDevice as non-CLS compliant.
  • +1/-0     
    Bug fix
    Actions.cs
    Replace obsolete property usage with non-obsolete version

    dotnet/src/webdriver/Interactions/Actions.cs

    • Replaced usage of obsolete inputDevice with InputDevice.
    +1/-1     

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link
    Contributor

    qodo-merge-pro bot commented Dec 4, 2024

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Code Consistency
    Verify that replacing the obsolete inputDevice property with InputDevice maintains the same behavior and doesn't introduce any regressions

    Copy link
    Contributor

    qodo-merge-pro bot commented Dec 4, 2024

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    General
    Follow standard naming conventions for public properties in C#

    The property should follow C# naming conventions by using PascalCase for public
    members. Since this is an obsolete property redirecting to InputDevice, it should
    maintain consistent casing.

    dotnet/src/webdriver/Interactions/ActionSequence.cs [76]

    -public InputDevice inputDevice => InputDevice;
    +public InputDevice InputDevice => InputDevice;
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: The suggestion correctly identifies a violation of C# naming conventions where public properties should use PascalCase. This is particularly important for maintaining code consistency, especially since the property redirects to a properly-named 'InputDevice' property.

    7

    💡 Need additional feedback ? start a PR chat

    @nvborisenko
    Copy link
    Member

    Why not, thank you @RenderMichael!

    @nvborisenko nvborisenko merged commit 22a6f0b into SeleniumHQ:trunk Dec 6, 2024
    1 check passed
    @RenderMichael RenderMichael deleted the input-device-warnings branch December 6, 2024 18:56
    sandeepsuryaprasad pushed a commit to sandeepsuryaprasad/selenium that referenced this pull request Dec 7, 2024
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    2 participants