Skip to content

[java] New rule: TypeNameMismatch - #7034

Merged
UncleOwen merged 5 commits into
pmd:mainfrom
zbynek:type-name
Sep 6, 2026
Merged

UncleOwen merged 5 commits into
pmd:mainfrom
zbynek:type-name

Conversation

@zbynek

@zbynek zbynek commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Describe the PR

Add a new rule for Java that checks a match between filename and class name.

Related issues

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

@zbynek
zbynek force-pushed the type-name branch 3 times, most recently from 45a931f to 45ebad4 Compare September 4, 2026 23:30
@pmd-actions-helper

pmd-actions-helper Bot commented Sep 5, 2026 •

Copy link
Copy Markdown
Contributor

Documentation Preview

Compared to main:
This changeset changes 0 violations,
introduces 2447 new violations, 0 new errors and 0 new configuration errors,
removes 0 violations, 16 errors and 9 configuration errors.
There are 0 changed duplications, 0 new duplications and 0 removed duplications.
There are 0 changed CPD errors, 0 new CPD errors and 0 removed CPD errors.

Regression Tester Report

(comment created at 2026-09-06 19:08:57+00:00 for 3566463)

@UncleOwen

Copy link
Copy Markdown
Member

Is this really codestyle? Maybe bestpractices fits better?

@zbynek

zbynek commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Moved to Best Practices. My original thought was that this is somewhat related to ClassNamingConvention, but you're right that this one is less stylistic and more about following conventions.

# Conflicts:
#	docs/pages/release_notes.md

@UncleOwen UncleOwen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@UncleOwen UncleOwen added this to the 7.28.0 milestone Sep 6, 2026
@UncleOwen
UncleOwen merged commit cdac021 into pmd:main Sep 6, 2026
13 checks passed
@adangel adangel added the a:new-rule Proposal to add a new built-in rule label Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a:new-rule Proposal to add a new built-in rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[java] New rule: TypeNameMismatch

3 participants