Skip to content

Commit

Permalink
Also ignore changes to any private level in changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
violine1101 committed Jul 15, 2023
1 parent 5321356 commit c217372
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class KeepPrivateModule(
setPrivate()

val markedTime = comments.first(::isKeepPrivateTag).created
val securityChange = changeLog
.lastOrNull { isSecurityChangeToPublic(it, project.privateSecurity) }
val securityChange = changeLog.lastOrNull(::isSecurityChangeToPublic)

val changedTime = securityChange?.created
if (changedTime != null && changedTime.isAfter(markedTime)) {
if (
Expand All @@ -47,8 +47,8 @@ class KeepPrivateModule(
comment.visibilityValue == "staff" &&
(comment.body?.contains(keepPrivateTag!!) ?: false)

private fun isSecurityChangeToPublic(item: ChangeLogItem, privateLevel: String) =
item.field == "security" && item.changedFromString == privateLevel
private fun isSecurityChangeToPublic(item: ChangeLogItem) =
item.field == "security" && privateLevels.contains(item.changedFromString)

private fun assertContainsKeepPrivateTag(comments: List<Comment>) = when {
comments.any(::isKeepPrivateTag) -> Unit.right()
Expand Down

0 comments on commit c217372

Please sign in to comment.