From a516775da6fda92a55a62418a081561127a1d5ca Mon Sep 17 00:00:00 2001 From: Nikita Pivkin Date: Thu, 8 May 2025 05:52:32 +0600 Subject: [PATCH] feat(misconf): add misconfiguration location to junit template (#8793) Signed-off-by: nikpivkin --- contrib/junit.tpl | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/contrib/junit.tpl b/contrib/junit.tpl index b351f62bb4..e4313c124f 100644 --- a/contrib/junit.tpl +++ b/contrib/junit.tpl @@ -15,6 +15,7 @@ {{- end }} +{{- $target := .Target }} {{- if .MisconfSummary }} {{- else }} @@ -28,7 +29,23 @@ {{ range .Misconfigurations }} {{- if (eq .Status "FAIL") }} - {{ escapeXML .Description }} + + {{- $target }}: + {{- with .CauseMetadata }} + {{- .StartLine }} + {{- if lt .StartLine .EndLine }}:{{ .EndLine }}{{ end }}: Occurrences: + {{- range $i := .Occurrences -}} + via {{ .Filename }}: + {{- .Location.StartLine }} + {{- if lt .Location.StartLine .Location.EndLine }}:{{ .Location.EndLine }}{{ end }} ({{ .Resource }}) + {{- end -}} + Code: + {{- range .Code.Lines }} + {{- if .IsCause }}{{ escapeXML .Content }} {{- end }} + {{- end }} + {{- end }} + {{- escapeXML .Description }} + {{- end }} {{- end }}