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

[java] SpotBugs exclude NM_CLASS_NAMING_CONVENTION #14596

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

mk868
Copy link
Contributor

@mk868 mk868 commented Oct 14, 2024

User description

Description

As described in this comment, SpotBugs found some additional bugs in the code.
In this PR I fix part of the found problems.

SpotBugs errors:

M B Nm: The class name org.openqa.selenium.devtools.v127.v127Log doesn't start with an upper case letter  At v127Log.java:[lines 30-82]
M B Nm: The class name org.openqa.selenium.devtools.v127.v127CdpInfo doesn't start with an upper case letter  At v127CdpInfo.java:[lines 27-28]
M B Nm: The class name org.openqa.selenium.devtools.v127.v127Events doesn't start with an upper case letter  At v127Events.java:[lines 37-108]
M B Nm: The class name org.openqa.selenium.devtools.v127.v127Javascript doesn't start with an upper case letter  At v127Javascript.java:[lines 30-84]
M B Nm: The class name org.openqa.selenium.devtools.v127.v127Target doesn't start with an upper case letter  At v127Target.java:[lines 36-107]
M B Nm: The class name org.openqa.selenium.devtools.v127.v127Network doesn't start with an upper case letter  At v127Network.java:[lines 40-223]
M B Nm: The class name org.openqa.selenium.devtools.v127.v127Domains doesn't start with an upper case letter  At v127Domains.java:[lines 37-68]
M B Nm: The class name org.openqa.selenium.devtools.v128.v128Events doesn't start with an upper case letter  At v128Events.java:[lines 37-108]
M B Nm: The class name org.openqa.selenium.devtools.v128.v128Network doesn't start with an upper case letter  At v128Network.java:[lines 40-223]
M B Nm: The class name org.openqa.selenium.devtools.v128.v128Javascript doesn't start with an upper case letter  At v128Javascript.java:[lines 30-84]
M B Nm: The class name org.openqa.selenium.devtools.v128.v128Domains doesn't start with an upper case letter  At v128Domains.java:[lines 37-68]
M B Nm: The class name org.openqa.selenium.devtools.v128.v128CdpInfo doesn't start with an upper case letter  At v128CdpInfo.java:[lines 27-28]
M B Nm: The class name org.openqa.selenium.devtools.v128.v128Log doesn't start with an upper case letter  At v128Log.java:[lines 30-82]
M B Nm: The class name org.openqa.selenium.devtools.v128.v128Target doesn't start with an upper case letter  At v128Target.java:[lines 36-107]
M B Nm: The class name org.openqa.selenium.devtools.v129.v129Network doesn't start with an upper case letter  At v129Network.java:[lines 40-223]
M B Nm: The class name org.openqa.selenium.devtools.v129.v129Log doesn't start with an upper case letter  At v129Log.java:[lines 30-82]
M B Nm: The class name org.openqa.selenium.devtools.v129.v129Events doesn't start with an upper case letter  At v129Events.java:[lines 37-108]
M B Nm: The class name org.openqa.selenium.devtools.v129.v129Javascript doesn't start with an upper case letter  At v129Javascript.java:[lines 30-84]
M B Nm: The class name org.openqa.selenium.devtools.v129.v129CdpInfo doesn't start with an upper case letter  At v129CdpInfo.java:[lines 27-28]
M B Nm: The class name org.openqa.selenium.devtools.v129.v129Target doesn't start with an upper case letter  At v129Target.java:[lines 36-107]
M B Nm: The class name org.openqa.selenium.devtools.v129.v129Domains doesn't start with an upper case letter  At v129Domains.java:[lines 37-68]

documentation

Solution:
Exclude these classes from SpotBugs checks. I used Regex to exclude current and future versions of classes.

Motivation and Context

Fixing the actual problems is necessary before enabling full SpotBugs analysis, in order to not break the build.

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


Description

  • Added a new exclusion rule in the SpotBugs configuration to ignore class naming convention violations for classes matching the pattern org.openqa.selenium.devtools.v[0-9]+\.v\w+.
  • This change addresses the SpotBugs errors related to class names not starting with an uppercase letter in the specified package.

Changes walkthrough 📝

Relevant files
Enhancement
spotbugs-excludes.xml
Add SpotBugs exclusion for class naming convention             

java/spotbugs-excludes.xml

  • Added a new exclusion rule for class naming convention.
  • Excluded classes matching the pattern
    org.openqa.selenium.devtools.v[0-9]+\.v\w+.
  • +6/-0     

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

    Copy link
    Contributor

    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 Quality
    The new exclusion rule for class naming convention might hide potential issues in the codebase. Consider if this is the best approach or if renaming the classes would be more appropriate.

    Copy link
    Contributor

    PR Code Suggestions ✨

    No code suggestions found for the PR.

    Copy link
    Contributor

    @pujagani pujagani left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Thank you @mk868!

    @pujagani pujagani merged commit edff2f3 into SeleniumHQ:trunk Oct 16, 2024
    9 of 11 checks passed
    @mk868 mk868 deleted the devtools-NM_CLASS_NAMING_CONVENTION branch October 16, 2024 16:49
    jman-sketch pushed a commit to jman-sketch/selenium that referenced this pull request Oct 17, 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