fix(NO-TASK): Make wp-plugin and wp-theme scopes only, add subject tags - #12
Merged
Merged
Conversation
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>
There was a problem hiding this comment.
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-themefrom thetype-enumallowlist and assert the old “type form” is rejected. - Add an optional subject tag segment to
headerPatternand updateexplain()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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task: NO-TASK
Overview
wp-pluginandwp-themebecome scopes only. The types areupdatefor a bump andremovefor a package that is gone. A new optional bracketed subject tag carries the context the scope slot can no longer hold.This reverses 1.3.0, which added
wp-plugin/wp-themeas types so release-please could give WordPress updates dedicated changelog sections — it groups strictly by type, andchangelog-sections[].typeis the only key its schema offers. The team settled on the scope form instead.Accepted consequence: WordPress updates now share whatever section
updatemaps 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: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-casekeeps judging the sentence rather than the label:update(wp-plugin): [.org] Update akismet to v5.3Update akismet to v5fix(PROJ-123): [hotfix] Correct the redirectCorrect the redirectupdate(wp-plugin): Update akismet to v5.3update(wp-plugin): [] Update akismetupdate(wp-plugin): [a b] Update akismetupdate(wp-plugin): [unclosed Update akismetupdate(wp-plugin): [.org]wp-plugin(wporg): Update akismet to v5.3explain()had to change too, not just the regexA 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
fixThe type allowlist narrows, so anything in flight using
wp-plugin/wp-themeas a type needs a rebase. Typed asfix(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
linchpin/renovatebot-configupdate(wp-plugin): [.org]linchpin/release-please-configVerified against all 21 Renovate rules: every rendered header and
commitBodyline returnsnullfromexplain(), matchesheaderPattern, keeps the tag out of the captured subject, and fitsheader-max-length(longest is 76 of 100).🤖 Generated with Claude Code