Skip to content

fix(NO-TASK): Make wp-plugin and wp-theme scopes only, add subject tags - #12

Merged
surrealwebs merged 1 commit into
mainfrom
fix/NO-TASK/wp-scopes-and-subject-tags
Aug 18, 2026
Merged

fix(NO-TASK): Make wp-plugin and wp-theme scopes only, add subject tags#12
surrealwebs merged 1 commit into
mainfrom
fix/NO-TASK/wp-scopes-and-subject-tags

Conversation

@surrealwebs

Copy link
Copy Markdown
Contributor

Task: NO-TASK

Overview

wp-plugin and wp-theme become scopes only. The types are update for a bump and remove for a package that is gone. A new optional bracketed subject tag carries the context the scope slot can no longer hold.

update(wp-plugin): [.org] Update akismet to v5.3
update(wp-plugin): [packagist] Update gravityforms to v3
remove(wp-plugin): Remove akismet

This reverses 1.3.0, which added wp-plugin/wp-theme as types so release-please could give WordPress updates dedicated changelog sections — it groups strictly by type, and changelog-sections[].type is the only key its schema offers. The team settled on the scope form instead.

Accepted consequence: WordPress updates now share whatever section update maps to (Changes to Existing Features 💅) rather than getting their own. Partly mitigated — release-please renders the scope as the bold prefix on each bullet, so plugin and theme lines stay distinguishable, and the tag stays visible in the text:

### Changes to Existing Features 💅

* **wp-plugin:** [.org] Update akismet to v5.3
* **wp-theme:** [.org] Update ollie-pro to v2.6.1

The tag

Free-form within [\w.\-]+ — a label for whoever reads the log, not a routing key, so there is no list to keep in sync. The charset is what keeps it a label: it rejects [see PROJ-1 for why], and an unclosed [ that would otherwise swallow the rest of the header.

Non-capturing on purpose, so subject-case keeps judging the sentence rather than the label:

Header Result
update(wp-plugin): [.org] Update akismet to v5.3 ✅ subject Update akismet to v5
fix(PROJ-123): [hotfix] Correct the redirect ✅ subject Correct the redirect
update(wp-plugin): Update akismet to v5.3 ✅ untagged unaffected
update(wp-plugin): [] Update akismet ❌ rejected
update(wp-plugin): [a b] Update akismet ❌ rejected
update(wp-plugin): [unclosed Update akismet ❌ rejected
update(wp-plugin): [.org] ❌ tag but no subject
wp-plugin(wporg): Update akismet to v5.3 ❌ the old type form

explain() had to change too, not just the regex

A leading [ previously collapsed into "The subject must start with a letter or number" — true of a bracket, and no help at all in fixing an otherwise fine header. A malformed tag now reports as a tag problem, and an unclosed one names the missing bracket. Three tests assert those cases are not misreported as subject problems.

Breaking-ish, and why this is a fix

The type allowlist narrows, so anything in flight using wp-plugin/wp-theme as a type needs a rebase. Typed as fix (patch) deliberately: 1.3.0 added those types against team intent, and this restores the intended contract rather than removing a wanted feature.

Review focus

index.js:3-11 — the comment now argues the opposite of what it argued in 1.3.0. Worth checking it states the trade-off honestly rather than just describing the code.

Companion PRs — merge this one first

Repo PR Why the order
linchpin/renovatebot-config emits update(wp-plugin): [.org] Its tags do not lint until this ships
linchpin/release-please-config drops 4 unreachable sections Its type mirror must never be ahead of this allowlist

Verified against all 21 Renovate rules: every rendered header and commitBody line returns null from explain(), matches headerPattern, keeps the tag out of the captured subject, and fits header-max-length (longest is 76 of 100).

🤖 Generated with Claude Code

1.3.0 allowed wp-plugin and wp-theme as commit types so that release-please
could give WordPress updates their own changelog sections - it groups strictly
by type, and `changelog-sections[].type` is the only key its schema offers.
The team settled on the scope form instead, so the type form is removed.

WordPress updates now share whatever section `update` maps to. The scope still
renders as the bold prefix on each changelog bullet, so plugin and theme lines
stay apart inside it.

That leaves the scope slot unable to carry a package's registry, which is what
the new subject tag is for:

    update(wp-plugin): [.org] Update akismet to v5.3
    update(wp-plugin): [packagist] Update gravityforms to v3

The tag is optional and free-form within `[\w.\-]+` - a label for whoever reads
the log, not a routing key. The charset is what keeps it a label: it rejects
`[see PROJ-1 for why]`, and an unclosed `[` that would otherwise swallow the
rest of the header. It is a non-capturing group, so subject-case keeps judging
the sentence rather than the label.

explain() had to learn about it too. A leading `[` previously collapsed into
"The subject must start with a letter or number" - true of a bracket, and no
help at all in fixing an otherwise fine header. A malformed tag now reports as
a tag problem, and an unclosed one names the missing bracket.

This narrows the type allowlist, so anything in flight using wp-plugin or
wp-theme as a type needs a rebase. linchpin/renovatebot-config is the main
source of those and is being changed alongside this.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 18, 2026 18:18
@surrealwebs
surrealwebs merged commit 6ce4621 into main Aug 18, 2026
6 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the commitlint configuration to treat wp-plugin / wp-theme as scopes only (removing them from the allowed type list) and introduces an optional bracketed subject tag (e.g. [.org], [packagist]) that is ignored by the captured subject for downstream rules like subject-case.

Changes:

  • Remove wp-plugin / wp-theme from the type-enum allowlist and assert the old “type form” is rejected.
  • Add an optional subject tag segment to headerPattern and update explain() to report tag-specific errors (including unclosed brackets) without misreporting them as subject problems.
  • Update README documentation and expand Jest coverage for the new scope/tag behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
README.md Documents wp-plugin/wp-theme as scopes only and adds the new “subject tags” convention plus updated rule list.
index.test.js Adds/updates tests to assert the type removal, the scope form, and tag parsing/error messaging behavior.
index.js Implements the narrowed type allowlist, subject-tag parsing in headerPattern, and tag-aware diagnostics in explain().

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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