Skip to content

Fail Core lint when analyzers fail#509

Merged
chubes4 merged 1 commit into
mainfrom
fix-core-dev-lint-failures
May 10, 2026
Merged

Fail Core lint when analyzers fail#509
chubes4 merged 1 commit into
mainfrom
fix-core-dev-lint-failures

Conversation

@chubes4
Copy link
Copy Markdown
Member

@chubes4 chubes4 commented May 10, 2026

Summary

  • Fail the WordPress core-dev lint runner when PHPCS, PHPStan, or JS lint fails instead of swallowing analyzer exits.
  • Treat missing Core PHPCS/PHPStan binaries as infrastructure failures with a composer install hint.
  • Prefer Core's phpcs.xml.dist while retaining .phpcs.xml.dist fallback, and add smoke coverage for success, analyzer failure, and missing PHPStan.

Motivation

This came out of reviewing why Homeboy did not flag a WordPress Core backport issue on WordPress/wordpress-develop#11766.

Weston Ruter noted a strict PHPStan foreach.nonIterable issue in src/wp-admin/site-editor.php: WordPress/wordpress-develop#11766 (comment)

Strict PHPStan did catch the issue when run directly, but Homeboy still reported success because the core-dev lint runner swallowed analyzer exits with || true. The runner also skipped PHPCS in Core because it looked for .phpcs.xml.dist while Core uses phpcs.xml.dist, and it treated missing Composer-installed analyzer binaries as warnings instead of actionable infrastructure failures.

Testing

  • bash wordpress/scripts/test/core-dev-shape-smoke.sh
  • bash -n wordpress/scripts/lint/lint-runner-core-dev.sh && bash -n wordpress/scripts/test/core-dev-shape-smoke.sh

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenCode (GPT-5.5)
  • Used for: Investigated the missed WordPress Core PHPStan coverage, drafted the shell runner fix and smoke coverage, and ran targeted validation. Chris remains responsible for review and merge.

@chubes4 chubes4 merged commit 94d64f6 into main May 10, 2026
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