Skip to content

[Naming] Keep mass nouns ending in "data"/"info" untouched when singularizing - #8492

Merged
TomasVotruba merged 1 commit into
mainfrom
fix-metadata-mass-noun-singularize
Sep 14, 2026
Merged

[Naming] Keep mass nouns ending in "data"/"info" untouched when singularizing#8492
TomasVotruba merged 1 commit into
mainfrom
fix-metadata-mass-noun-singularize

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

The RenameForeachValueVariableToMatchMethodCallReturnTypeRector renamed foreach variables like $ruleMetadata (over RuleMetadata[]) to $ruleMetadatum.

Root cause is in RectorNamingInflector::singularize(). The Data|Info suffix guard only matches capitalized Data/Info camel words (eg userData), so ruleMetadata - which ends in lowercase data, the tail of the single word metadata - fell through to the plain inflector and became ruleMetadatum.

Now names ending in lowercase data/info (mass nouns like metadata) are kept untouched.

Before:

ruleMetadata -> ruleMetadatum

After:

ruleMetadata -> ruleMetadata

Existing behaviour is preserved:

  • userData -> userData
  • ruleMetadatas -> ruleMetadata
  • classInfos -> classInfo

Added a skip fixture covering a RuleMetadata[] return type.

https://claude.ai/code/session_01GpZfp2wM56hSqNVvLPSY5T

…larizing

Names like "ruleMetadata" ended in lowercase "data", which the Data/Info
suffix guard (matching only capitalized "Data"/"Info" words) missed, so they
fell through to the plain inflector and became "ruleMetadatum".

Claude-Session: https://claude.ai/code/session_01GpZfp2wM56hSqNVvLPSY5T
@TomasVotruba
TomasVotruba merged commit 0c2c04e into main Sep 14, 2026
45 checks passed
@TomasVotruba
TomasVotruba deleted the fix-metadata-mass-noun-singularize branch September 14, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant