Skip to content

Commit

Permalink
Do not log empty line when unused warnings are not logged
Browse files Browse the repository at this point in the history
  • Loading branch information
remcomokveld committed Feb 9, 2024
1 parent 4424b26 commit 8f907ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/kotlin/app/cash/licensee/task.kt
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@ abstract class LicenseeTask : DefaultTask() {
if (validationResult.configResults.isNotEmpty() && validationResult.artifactResults.isNotEmpty()) {
validationReport.appendLine()
// We know these are always at warning or error level, so use lifecycle for space.
logger.log(lifecycleLevel, "")
if (unusedWarningLevel > INFO || unusedErrorLevel > INFO || logger.isInfoEnabled)
logger.log(lifecycleLevel, "")
}
for ((artifactDetail, results) in validationResult.artifactResults) {
val coordinateHeader = buildString {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ class LicenseePluginFixtureTest {
|WARNING: Allowed .*? is unused
""".trimMargin(),
)
assertThat(result.output).doesNotContainMatch("""\n\n> Task :licensee""")
}

@Test fun unusedWarn(
Expand Down

0 comments on commit 8f907ad

Please sign in to comment.