Skip to content

Commit 6f6b2b0

Browse files
committed
chore(npm): Improve the detection of multi-line hints
Add "gitignore-fallback " as a pattern and ensure it is not used as a prefix for multi-line hints. Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
1 parent dca505d commit 6f6b2b0

File tree

1 file changed

+8
-2
lines changed
  • plugins/package-managers/node/src/main/kotlin/npm

1 file changed

+8
-2
lines changed

plugins/package-managers/node/src/main/kotlin/npm/Npm.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,13 @@ internal fun List<String>.groupLines(vararg markers: String): List<String> {
282282
"path ",
283283
"syscall "
284284
)
285-
val singleLinePrefixes =
286-
setOf("deprecated ", "invalid: ", "missing: ", "skipping integrity check for git dependency ")
285+
val singleLinePrefixes = setOf(
286+
"deprecated ",
287+
"gitignore-fallback ",
288+
"invalid: ",
289+
"missing: ",
290+
"skipping integrity check for git dependency "
291+
)
287292
val minCommonPrefixLength = 5
288293

289294
val issueLines = mapNotNull { line ->
@@ -337,6 +342,7 @@ internal fun List<String>.groupLines(vararg markers: String): List<String> {
337342

338343
// If no lines but the last end with a dot, assume the message to be a single sentence.
339344
val isMultiLineSentence = nonFooterLines.size > 1
345+
&& nonFooterLines.none { line -> singleLinePrefixes.any { line.startsWith(it) } }
340346
&& nonFooterLines.last().endsWith('.')
341347
&& nonFooterLines.subList(0, nonFooterLines.size - 1).none { it.endsWith('.') }
342348

0 commit comments

Comments
 (0)