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
devDependencies
because the git diff logic required both the start and end of thedevDependencies
section to be visible. In many cases, especially with limited diff context (-U20
), the closing brace of thedevDependencies
section might not be included in the diff output.Solution
devDependencies
section start to be founddevDependencies
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
Relax devDependencies detection in package.json diffs to work when the closing brace isn’t present, treating all lines after the start as within the section.
src/changelog-check.ts
):getDevDependencyLines
:devDependencies
; no longer depends on detecting the end.devDependencies
.Written by Cursor Bugbot for commit 819cf6d. This will update automatically on new commits. Configure here.