Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
### What's done:
* WIP
  • Loading branch information
kgevorkyan committed Jan 23, 2023
1 parent 85cc04f commit 65a8662
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ class FixPlugin(
* @param execCmd execution command for debug info
* @param stdout std out of executed tool, if any
* @param stderr std err of executed tool, if any
* @param fixFormat fix format
* @return list of the test results
*/
private fun buildTestResultsForChunk(
Expand Down Expand Up @@ -268,9 +267,9 @@ class FixPlugin(
val tmpDirAdjusted = FileSystem.SYSTEM_TEMPORARY_DIRECTORY.toString().replaceSeparators()
return if (currentPathAdjusted.startsWith(tmpDirAdjusted)) {
currentPathAdjusted
// remove tmpDir
// trim tmpDir
.substringAfter("$tmpDirAdjusted/")
// remove FixPlugin dir
// trim tmp FixPlugin dir
.substringAfter("/")
.toPath()
} else {
Expand All @@ -280,7 +279,10 @@ class FixPlugin(

private fun Path.trimTestRootPath(): Path {
val currentPathAdjusted = this.toString().replaceSeparators()
val testRootPathAdjusted = testConfig.getRootConfig().directory.toString().replaceSeparators()
val testRootPathAdjusted = testConfig.getRootConfig()
.directory
.toString()
.replaceSeparators()
return if (currentPathAdjusted.startsWith(testRootPathAdjusted)) {
currentPathAdjusted
.substringAfter("$testRootPathAdjusted/")
Expand All @@ -290,9 +292,7 @@ class FixPlugin(
}
}

private fun String.replaceSeparators(): String {
return this.replace("\\", "/")
}
private fun String.replaceSeparators(): String = this.replace("\\", "/")

private fun failTestResult(
chunk: List<FixTestFiles>,
Expand Down

0 comments on commit 65a8662

Please sign in to comment.