Skip to content

Commit

Permalink
Fix CSV headers after moving line and column
Browse files Browse the repository at this point in the history
  • Loading branch information
mtdowling committed Feb 12, 2024
1 parent cb8c8e2 commit 7b33415
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void print(CliPrinter printer, ValidationEventFormatter formatter, ValidationEve
CSV {
@Override
void beginPrinting(CliPrinter printer) {
printer.println("severity,id,shape,file,message,hint,suppressionReason");
printer.println("severity,id,shape,file,line,column,message,hint,suppressionReason");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void canOutputCsv() throws Exception {

String[] lines = result.stdout().split("(\\r\\n|\\r|\\n)");
assertThat(lines.length, is(2));
assertThat(lines[0], containsString("severity,id,shape,file,message,hint,suppressionReason"));
assertThat(lines[0], containsString("severity,id,shape,file,line,column,message,hint,suppressionReason"));
assertThat(lines[1], containsString("\"ERROR\",\"ChangedShapeType\",\"smithy.example#Hello\""));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;

import java.net.URISyntaxException;
Expand Down Expand Up @@ -228,6 +229,9 @@ public void canOutputCsv() throws Exception {
assertThat(result.stdout(), containsString("EmitDangers"));
assertThat(result.stdout(), containsString("HttpLabelTrait"));
assertThat(result.stdout(), not(containsString("FAILURE"))); // stderr

String[] lines = result.stdout().split("(\\r\\n|\\r|\\n)");
assertThat(lines[0], containsString("severity,id,shape,file,line,column,message,hint,suppressionReason"));
}

@Test
Expand Down

0 comments on commit 7b33415

Please sign in to comment.