From e5a4d84a6f4ec3c43ff4a829d786b048951ce671 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Tue, 7 Mar 2023 20:59:02 +1100 Subject: [PATCH] improve compact version sorting --- .../hl7/fhir/validation/cli/renderers/CompactRenderer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/renderers/CompactRenderer.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/renderers/CompactRenderer.java index 62ec2800b..6cd1950df 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/renderers/CompactRenderer.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/renderers/CompactRenderer.java @@ -41,11 +41,11 @@ public class CompactRenderer extends ValidationOutputRenderer { String path = issue.hasExpression() ? issue.getExpression().get(0).asStringValue() : "n/a"; int line = ToolingExtensions.readIntegerExtension(issue, ToolingExtensions.EXT_ISSUE_LINE, -1); int col = ToolingExtensions.readIntegerExtension(issue, ToolingExtensions.EXT_ISSUE_COL, -1); - lines.add("["+Integer.toString(line) + ", " + Integer.toString(col)+"] "+path+": "+issue.getSeverity().getDisplay()+" - "+issue.getDetails().getText()); + lines.add(Utilities.padLeft(Integer.toString(line), '0', 8) + ":" + Utilities.padLeft(Integer.toString(col), '0', 8)+":"+path+"|["+Integer.toString(line) + ", " + Integer.toString(col)+"] "+path+": "+issue.getSeverity().getDisplay()+" - "+issue.getDetails().getText()); } Collections.sort(lines); for (String s : lines) { - d.println(s); + d.println(s.substring(s.indexOf("|")+1)); } }