Skip to content

chore: Format changelogs with Oxfmt#8442

Merged
Mrtenz merged 10 commits intomainfrom
mrtenz/oxfmt-changelog
Apr 15, 2026
Merged

chore: Format changelogs with Oxfmt#8442
Mrtenz merged 10 commits intomainfrom
mrtenz/oxfmt-changelog

Conversation

@Mrtenz
Copy link
Copy Markdown
Member

@Mrtenz Mrtenz commented Apr 13, 2026

Explanation

This updates changelog validation to use Oxfmt instead of Prettier.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Low Risk
Primarily build/lint tooling and dependency bumps; no runtime/controller logic changes, with only minor risk of CI/release automation differences due to formatter changes.

Overview
Updates changelog automation to use Oxfmt instead of Prettier by passing --formatter oxfmt in scripts/update-changelog.sh and scripts/validate-changelog.sh, and by wiring create-release-branch to use the same formatter.

Bumps @metamask/auto-changelog to ^6.1.0 across packages (and updates @metamask/create-release-branch), removes changelog-specific lint steps from some packages, and tweaks .oxfmtrc.json/lint:misc so Oxfmt is the primary formatter and changelogs are no longer specially ignored.

Reviewed by Cursor Bugbot for commit da6cf29. Bugbot is set up for automated code reviews on this repo. Configure here.

@socket-security
Copy link
Copy Markdown

socket-security bot commented Apr 13, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​metamask/​auto-changelog@​6.0.0 ⏵ 6.1.096100100 +194 +2100
Updated@​metamask/​create-release-branch@​4.1.4 ⏵ 4.2.0100 +21100100 +1100 +10100

View full report

Mrtenz added a commit to MetaMask/auto-changelog that referenced this pull request Apr 13, 2026
This adds a new `--formatter` option, which can be set to either
"prettier" or "oxfmt", and deprecates the `--prettier` option. I've also
refactored the logic to load Prettier dynamically, so both Oxfmt and
Prettier are now _optional_ peer dependencies.

Tested in `MetaMask/core`:
- MetaMask/core#8442

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Moderate risk: changes CLI flags and formatting behavior via dynamic
imports, which could affect consumers relying on the deprecated
`--prettier` flag or missing optional peer deps at runtime.
> 
> **Overview**
> Adds a new `--formatter` CLI option to choose changelog formatting
(`prettier` or `oxfmt`, with `none` for `validate`) and deprecates the
legacy `--prettier` flag (which still takes precedence when provided).
> 
> Refactors changelog formatting to route through new
`src/formatters.ts` helpers that dynamically import Prettier/Oxfmt and
throw clearer errors when the chosen formatter isn’t installed, and
updates tests and package metadata to treat `prettier`/`oxfmt` as
*optional* peer dependencies.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
b0fc35a. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
@Mrtenz Mrtenz force-pushed the mrtenz/oxfmt-changelog branch from 4cb9678 to 9756ff8 Compare April 15, 2026 16:05
Comment thread package.json
"build:types": "tsc --build tsconfig.build.json --verbose",
"changelog:update": "yarn workspaces foreach --all --no-private --parallel --interlaced --verbose run changelog:update",
"changelog:validate": "yarn workspaces foreach --all --no-private --parallel --interlaced --verbose run changelog:validate",
"create-release-branch": "create-release-branch --formatter oxfmt",
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This overrides the binary create-release-branch when running yarn create-release-branch, but Yarn is still able to resolve the actual binary in the script. It's a bit hacky though, so we may also want to consider creating a script with a different name (yarn create-release?).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmm... good point.

I'd hate to have two different commands to do the same thing. I feel like that would be confusing. Maybe we should give create-release-branch the ability to read from a createReleaseBranch property in package.json, and we can set formatter there instead of using a command-line option?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Was thinking about having a config option as well. We already have release.config.json, so maybe it makes sense to add the option there, and have auto-changelog and create-release-branch read from that?

Do you think we should do that before merging this?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

True, we do have that config file. It's currently used by action-publish-release, but we could certainly reuse it for this purpose.

Do you think we should do that before merging this?

I was thinking we would at first, but perhaps we don't have to. I guess hardly anyone uses yarn exec create-release-branch to run this tool; it's more likely they use yarn create-release-branch (and I believe this is what we advise in the release instructions anyway). So maybe it would only be confusing for us.

I do think it would be a good idea for create-release-branch to read formatter from a config file so we wouldn't need this line, but maybe having a "hack" for now isn't so bad.

@Mrtenz Mrtenz marked this pull request as ready for review April 15, 2026 16:17
@Mrtenz Mrtenz requested review from a team as code owners April 15, 2026 16:17
@Mrtenz Mrtenz requested review from a team as code owners April 15, 2026 16:17
@Mrtenz Mrtenz enabled auto-merge April 15, 2026 16:19
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b9e7abd. Configure here.

Comment thread scripts/create-package/package-template/package.json Outdated
Copy link
Copy Markdown
Contributor

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

LGTM.

@Mrtenz Mrtenz added this pull request to the merge queue Apr 15, 2026
Merged via the queue into main with commit f6a75dd Apr 15, 2026
345 checks passed
@Mrtenz Mrtenz deleted the mrtenz/oxfmt-changelog branch April 15, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants