com.avito.android.diff.formatter.DefaultOwnersDiffMessageFormatter.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of code-ownership Show documentation
Show all versions of code-ownership Show documentation
Collection of infrastructure libraries and gradle plugins of Avito Android project
The newest version!
package com.avito.android.diff.formatter
import com.avito.android.diff.model.OwnersDiff
public class DefaultOwnersDiffMessageFormatter : OwnersDiffMessageFormatter {
override fun formatDiffMessage(diffs: OwnersDiff): String {
return buildString {
append("Found difference in code owners structure!\n")
if (diffs.removed.isNotEmpty()) {
val removedOwners = diffs.removed.joinToString { it.toString() }
append("*Removed owners:* $removedOwners\n")
}
if (diffs.added.isNotEmpty()) {
val addedOwners = diffs.added.joinToString { it.toString() }
append("*Added owners:* $addedOwners")
}
}
}
}