Skip to content

Avoid spelling false positives for machine-readable WordPress identifiers - #507

Open
jamesbregenzer wants to merge 2 commits into
WordPress:trunkfrom
jamesbregenzer:fix-wordpress-spelling-machine-identifiers
Open

jamesbregenzer wants to merge 2 commits into
WordPress:trunkfrom
jamesbregenzer:fix-wordpress-spelling-machine-identifiers

Conversation

@jamesbregenzer

Copy link
Copy Markdown

Summary

The spelling check flags the lowercase wordpress slug in the PHP array reported in #505, even though that key and its nested value are machine-readable identifiers. The displayed label remains WordPress.

This updates the PHP spelling-check path to tokenize PHP and mask the exact lowercase wordpress array key and its matching nested value in that entry. Line and newline positions are preserved. Display strings, translated text, unrelated value fields, other entries, and non-PHP files remain subject to the existing spelling check. The regression covers the reported short-array form; it does not claim to cover every array(...) layout.

Testing

  • The seven-case standalone regression passes under PHP 8.1 and PHP 8.4.
  • PHP syntax checks and git diff --check pass.
  • Theme Check has no normal test target for this script. The full suite, a WordPress installation, WordPress.org's deployed scanner, and a live upload scan were not tested.

Would you review whether this narrowly scoped exception matches the intended machine-readable slug handling?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant