Skip to content

Commit

Permalink
fix(node): Deduplicate issue lines before collapsing them
Browse files Browse the repository at this point in the history
Duplicate lines might confuse the common prefix finder logic.

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Jan 25, 2024
1 parent 27e0084 commit 73b2efa
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5161,10 +5161,6 @@ issues:
source: "NPM"
message: "deprecated [email protected]: Please upgrade to v1.0.1"
severity: "WARNING"
- timestamp: "1970-01-01T00:00:00Z"
source: "NPM"
message: "deprecated [email protected]: Please upgrade to v1.0.1"
severity: "WARNING"
- timestamp: "1970-01-01T00:00:00Z"
source: "NPM"
message: "deprecated [email protected]: Please upgrade to v0.1.5"
Expand All @@ -5173,10 +5169,6 @@ issues:
source: "NPM"
message: "deprecated [email protected]: Please upgrade to v1.0.1"
severity: "WARNING"
- timestamp: "1970-01-01T00:00:00Z"
source: "NPM"
message: "deprecated [email protected]: Please upgrade to v1.0.1"
severity: "WARNING"
- timestamp: "1970-01-01T00:00:00Z"
source: "NPM"
message: "deprecated [email protected]: Legacy versions of mkdirp are no longer supported.\
Expand Down
2 changes: 1 addition & 1 deletion plugins/package-managers/node/src/main/kotlin/Npm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ open class Npm(
var commonPrefix: String
var previousPrefix = ""

val collapsedLines = issueLines.fold(mutableListOf<String>()) { messages, line ->
val collapsedLines = issueLines.distinct().fold(mutableListOf<String>()) { messages, line ->
if (messages.isEmpty()) {
// The first line is always added including the prefix. The prefix will be removed later.
messages += line
Expand Down

0 comments on commit 73b2efa

Please sign in to comment.