File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/generator Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -133,21 +133,26 @@ object TestGenerator {
133
133
}
134
134
}
135
135
136
- private fun mergeSarifReports (model : GenerateTestsModel , sarifReportsPath : Path ) {
136
+ private fun mergeSarifReports (model : GenerateTestsModel , sarifReportsPath : Path ) {
137
+ val mergedReportFile = sarifReportsPath
138
+ .resolve(" ${model.project.name} Report.sarif" )
139
+ .toFile()
140
+ // deleting the old report so that `sarifReports` does not contain it
141
+ mergedReportFile.delete()
142
+
137
143
val sarifReports = sarifReportsPath.toFile()
138
144
.walkTopDown()
139
145
.filter { it.extension == " sarif" }
140
146
.map { it.readText() }
141
147
.toList()
142
148
143
149
val mergedReport = SarifReport .mergeReports(sarifReports)
144
- val mergedReportPath = sarifReportsPath.resolve(" ${model.project.name} Report.sarif" )
145
- mergedReportPath.toFile().writeText(mergedReport)
150
+ mergedReportFile.writeText(mergedReport)
146
151
147
152
// notifying the user
148
153
SarifReportNotifier .notify(
149
154
info = """
150
- SARIF report was saved to ${toHtmlLinkTag(mergedReportPath.toString() )}$HTML_LINE_SEPARATOR
155
+ SARIF report was saved to ${toHtmlLinkTag(mergedReportFile.path )}$HTML_LINE_SEPARATOR
151
156
You can open it using the VS Code extension "Sarif Viewer"
152
157
""" .trimIndent()
153
158
)
You can’t perform that action at this time.
0 commit comments