Skip to content

✨ New Generic.WhiteSpace.GotoTargetSpacing sniff#1026

Merged
jrfnl merged 1 commit into
4.xfrom
phpcs-4.0/feature/new-generic-gototargetspacing-sniff
Apr 18, 2025
Merged

✨ New Generic.WhiteSpace.GotoTargetSpacing sniff#1026
jrfnl merged 1 commit into
4.xfrom
phpcs-4.0/feature/new-generic-gototargetspacing-sniff

Conversation

@jrfnl

@jrfnl jrfnl commented Apr 17, 2025

Copy link
Copy Markdown
Member

Description

What with the colon for a goto target label no longer being tokenized to be included in the label token, let's allow for people to enforce no space between the label and the colon.

This commit introduces a new sniff to do just that.

Includes tests.
Includes documentation.

Suggested changelog entry

Added:
New sniff Generic.WhiteSpace.GotoTargetSpacing to enforce no space between the label of a goto target and the colon following it.

Related issues/external references

Related to #185

@jrfnl

jrfnl commented Apr 17, 2025

Copy link
Copy Markdown
Member Author

Just saw I cherrypicked an outdated commit. Fixed up now.

What with the colon for a goto target label no longer being tokenized to be included in the label token, let's allow for people to enforce no space between the label and the colon.

This commit introduces a new sniff to do just that.

Includes tests.
Includes documentation.

Related to 185
@jrfnl
jrfnl force-pushed the phpcs-4.0/feature/new-generic-gototargetspacing-sniff branch from d2e0cc0 to a133003 Compare April 17, 2025 21:58
@jrfnl
jrfnl merged commit cfe06b9 into 4.x Apr 18, 2025
@jrfnl
jrfnl deleted the phpcs-4.0/feature/new-generic-gototargetspacing-sniff branch April 18, 2025 13:33
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.

1 participant