Skip to content

Commit 01eb96f

Browse files
committed
fix(changelog-check): improve devDependencies section detection in git diffs
1 parent bcf27ba commit 01eb96f

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/changelog-check.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,21 +140,20 @@ const getDevDependencyLines = (
140140
}
141141
}
142142

143-
if (
144-
devDependencySectionStart === undefined ||
145-
devDependencySectionEnd === undefined
146-
) {
143+
if (devDependencySectionStart === undefined) {
147144
return [];
148145
}
149146

150147
// Check which nonVersionLines fall within devDependencies sections
151148
for (const changeLine of nonVersionLines) {
152149
const lineIndex = allLines.findIndex((line) => line === changeLine);
153150
if (lineIndex !== -1) {
154-
// Check if this line falls within any devDependencies section
151+
// Check if this line falls within the devDependencies section
152+
// If we don't have an end, assume everything after start is in devDependencies
155153
const isInDevDeps =
156154
lineIndex >= devDependencySectionStart &&
157-
lineIndex <= devDependencySectionEnd;
155+
(devDependencySectionEnd === undefined ||
156+
lineIndex <= devDependencySectionEnd);
158157

159158
if (isInDevDeps) {
160159
devDependencyLines.push(changeLine);

0 commit comments

Comments
 (0)