Skip to content

Introduce PHPCS, align to HM coding & CI build standards#3

Merged
kadamwhite merged 17 commits into
mainfrom
phpcs
Jul 2, 2026
Merged

Introduce PHPCS, align to HM coding & CI build standards#3
kadamwhite merged 17 commits into
mainfrom
phpcs

Conversation

@kadamwhite

@kadamwhite kadamwhite commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator
  • Adds HMCS
  • Adds composer phpcs script to run HMCS against project
  • Adds CI to run PHPCS sniffs in pull requests
  • Autofixes phpcbf-compatible issues
  • Moves plugin logic into namespace.php and plugin.php for parity with HM file organization standards
  • Refactors methods slightly to simplify output escaping

@kadamwhite kadamwhite force-pushed the phpcs branch 2 times, most recently from 53ac430 to ac1c975 Compare July 2, 2026 13:53
Adjusts output to pass computed values through esc_attr. Results in an
empty style attribute in one render path, but that does not impact render
and allows us to more easily escape values when they exist than if we
continued to pass the value as an `attribute="value;"` pair.
WP standard is that blocks are responsible for their own escaping, since dynamic blocks can render kses-incompatible markup like inline SVG that would be stripped with naive escaping here.
@kadamwhite kadamwhite changed the title Introduce PHPCS, align to HM coding standards Introduce PHPCS, align to HM coding & CI build standards Jul 2, 2026
@kadamwhite kadamwhite merged commit b5b7228 into main Jul 2, 2026
2 checks passed
@kadamwhite kadamwhite deleted the phpcs branch July 2, 2026 18:26
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.

2 participants