Skip to content

Commit

Permalink
helper-cli: Simplify the code to read copyright garbage files
Browse files Browse the repository at this point in the history
Note that expandTilde() is already called by the option conversion.

Signed-off-by: Sebastian Schuberth <[email protected]>
  • Loading branch information
sschuberth committed Apr 9, 2021
1 parent cd0188a commit f13d589
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ internal class ImportCopyrightGarbageCommand : CliktCommand(
.required()

override fun run() {
val entriesToImport = inputCopyrightGarbageFile
.readText()
.lines()
.filterNot { it.isBlank() }
val entriesToImport = inputCopyrightGarbageFile.readLines().filterNot { it.isBlank() }

val existingCopyrightGarbage = if (outputCopyrightGarbageFile.isFile) {
outputCopyrightGarbageFile.readValue<CopyrightGarbage>().items
Expand Down
5 changes: 1 addition & 4 deletions helper-cli/src/main/kotlin/commands/MapCopyrightsCommand.kt
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@ internal class MapCopyrightsCommand : CliktCommand(
.required()

override fun run() {
val processedCopyrightStatements = inputCopyrightGarbageFile
.readText()
.lines()
.filterNot { it.isBlank() }
val processedCopyrightStatements = inputCopyrightGarbageFile.readLines().filterNot { it.isBlank() }

val unprocessedCopyrightStatements = ortFile
.readValue<OrtResult>()
Expand Down

0 comments on commit f13d589

Please sign in to comment.