Skip to content

Commit

Permalink
Fixed formatting util
Browse files Browse the repository at this point in the history
  • Loading branch information
anchouls committed Dec 11, 2023
1 parent 40bc8fb commit 56ca009
Showing 1 changed file with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.command.WriteCommandAction
import com.intellij.psi.PsiFile
import com.intellij.psi.codeStyle.CodeStyleManager
import org.jetbrains.academy.test.system.inspections.applyInspections
import org.jetbrains.kotlin.idea.inspections.KotlinUnusedImportInspection
import org.junit.jupiter.api.Assertions

// TODO: make it possible to check different aspects of formatting
Expand All @@ -32,10 +30,3 @@ fun PsiFile.formatting(): String? {
}
return ApplicationManager.getApplication().runReadAction<String> { text }
}

fun PsiFile.checkIfOptimizeImportsWereApplied() {
Assertions.assertTrue(
applyInspections(listOf(KotlinUnusedImportInspection())).isEmpty(),
"Please, apply \"Optimize import\" option when formatting code."
)
}

0 comments on commit 56ca009

Please sign in to comment.