Skip to content

fix(scripts): POSIX [[:space:]] for BSD sed — macOS compatibility - #2

Open
adityaarsharma wants to merge 1 commit into
mainfrom
fix/bsd-sed-compat
Open

fix(scripts): POSIX [[:space:]] for BSD sed — macOS compatibility#2
adityaarsharma wants to merge 1 commit into
mainfrom
fix/bsd-sed-compat

Conversation

@adityaarsharma

Copy link
Copy Markdown
Owner

Summary

13 release-gate scripts × 47 lines patched. Replaces GNU \s shorthand inside sed -E commands with the POSIX [[:space:]] bracket expression so the gauntlet runs on macOS without silent failures.

Why

The most user-visible bug: check-version-parity.sh returning the full "## 3.0.0 — 2026-05-11" string as CHANGELOG_VER because BSD sed silently keeps the leading ## and trailing date. Result: every macOS user got a false-positive Mismatch FAIL on otherwise correct plugins.

Several other scripts (check-plugin-header.sh, check-readme-txt.sh, check-pot-file.sh, etc.) had the same issue in their sed extractions for version/header parsing.

Also fixed

Tightened check-pot-file.sh JS i18n scan with --exclude=*.min.js so minified vendor bundles (Chart.js, etc.) don't trigger false wp.i18n positives. The original regex matched bare _n( and _x( which collide with minified function names like _x(t,e).

Scripts touched

File Lines
check-license.sh 1
check-modern-wp.sh 1
check-ownership-transfer.sh 5
check-php-compat.sh 1
check-plugin-header.sh 4
check-pot-file.sh 2 + vendor exclude
check-readme-txt.sh 3
check-rtl-readiness.sh 1
check-version-parity.sh 3
check-wp-compat.sh 1
check-wp-org-guidelines.sh 1
generate-design-md.sh 16
scaffold-tests.sh 5

Test plan

  • Patched scripts verified line-by-line — only sed-context \s replaced
  • Full pre-release gauntlet ran on a real WordPress plugin (EDD Reports 3.0.0) on macOS Sonoma + BSD sed — all 8 release-blocking gates now PASS (were silently failing before)
  • Linux behavior unchanged — [[:space:]] is POSIX, identical semantics on both
  • grep -E calls untouched (BSD grep already accepts \s)

Backward compatibility

Zero. [[:space:]] and \s are semantically identical for whitespace matching; this is purely a portability change.

🤖 Generated with Claude Code

13 release-gate scripts × 47 lines patched. Replaces GNU `\s` shorthand
inside `sed -E` commands with the POSIX `[[:space:]]` bracket expression
so the gauntlet runs on macOS without silent failures.

The most user-visible bug this fixed: `check-version-parity.sh` returning
the full "## 3.0.0 — 2026-05-11" string as CHANGELOG_VER because BSD sed
silently kept the leading "## " and trailing date. Result: every Mac user
saw a false-positive "Mismatch" FAIL on otherwise correct plugins.

Also tightens `check-pot-file.sh` JS i18n scan with `--exclude=*.min.js`
so minified vendor bundles (Chart.js, etc.) don't trigger false wp.i18n
positives. The original regex matched bare `_n(` and `_x(` which collide
with minified function names like `_x(t,e)`.

Scripts touched:
  check-license.sh             (1 line)
  check-modern-wp.sh           (1 line)
  check-ownership-transfer.sh  (5 lines)
  check-php-compat.sh          (1 line)
  check-plugin-header.sh       (4 lines)
  check-pot-file.sh            (2 lines + vendor exclude)
  check-readme-txt.sh          (3 lines)
  check-rtl-readiness.sh       (1 line)
  check-version-parity.sh      (3 lines)
  check-wp-compat.sh           (1 line)
  check-wp-org-guidelines.sh   (1 line)
  generate-design-md.sh       (16 lines)
  scaffold-tests.sh            (5 lines)

Verified by running the full pre-release gauntlet on a real WordPress
plugin (EDD Reports 3.0.0) on macOS Sonnet/BSD sed. All gates pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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