-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed close outputStream as separate listener (#1688)
- Loading branch information
Showing
9 changed files
with
85 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
diktat-ktlint-engine/src/main/kotlin/com/saveourtool/diktat/ktlint/ReporterV2Wrapper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.saveourtool.diktat.ktlint | ||
|
||
import com.pinterest.ktlint.cli.reporter.core.api.KtlintCliError | ||
import com.pinterest.ktlint.cli.reporter.core.api.ReporterV2 | ||
|
||
/** | ||
* Wrapper for [ReporterV2] | ||
* | ||
* @param reporterV2 | ||
*/ | ||
open class ReporterV2Wrapper(private val reporterV2: ReporterV2) : ReporterV2 { | ||
override fun beforeAll() = reporterV2.beforeAll() | ||
|
||
override fun before(file: String) = reporterV2.before(file) | ||
|
||
override fun onLintError(file: String, ktlintCliError: KtlintCliError) = reporterV2.onLintError(file, ktlintCliError) | ||
|
||
override fun after(file: String) = reporterV2.after(file) | ||
|
||
override fun afterAll() = reporterV2.afterAll() | ||
|
||
companion object { | ||
/** | ||
* @return unwrapped [ReporterV2Wrapper] if it's required | ||
*/ | ||
fun ReporterV2.unwrapIfNeeded(): ReporterV2 = if (this is ReporterV2Wrapper) { | ||
this.reporterV2 | ||
} else { | ||
this | ||
} | ||
} | ||
} |