fix(changelog-check): improve devDependencies section detection in git diffs #101
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.
Problem
The changelog check was failing to properly detect when package.json changes were only in
devDependenciesbecause the git diff logic required both the start and end of thedevDependenciessection to be visible. In many cases, especially with limited diff context (-U20), the closing brace of thedevDependenciessection might not be included in the diff output.Solution
-U9999) instead of (-U20)Testing
This fix ensures that packages with only devDependency changes are properly skipped during changelog checks, preventing false positives that would require unnecessary changelog updates.
This should resolve the CI failure that occurred in this PR: MetaMask/core#6331
Impact
Note
Increase git diff context to
-U9999sopackage.jsonsection headers (e.g.,devDependencies) are reliably present in diffs.src/changelog-check.ts):git diff -U9999(max context) when analyzingpackage.jsonchanges to ensure section headers like"devDependencies"are visible for accurate detection.Written by Cursor Bugbot for commit 39fafdd. This will update automatically on new commits. Configure here.