Skip to content

Commit

Permalink
Merge pull request #622 from ghedwards/prevent-negative-column
Browse files Browse the repository at this point in the history
bugInfo.getColumn() is returning negative values in some cases
  • Loading branch information
ryaneberly authored Jun 16, 2020
2 parents 74fd99c + cf69bce commit a3db63b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/com/cflint/TextOutput.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ public void output(final BugList bugList, final Writer sb, CFLintStats stats) th
for (final BugInfo bugInfo : bugEntry.getValue()) {
final String severity = bugEntry.getValue().get(0).getSeverity().toString();
final String code = bugEntry.getValue().get(0).getMessageCode();
final Integer column = bugInfo.getColumn();
sb.append(NEW_LINE).append("Severity:").append(severity);
sb.append(NEW_LINE).append("Message code:").append(code);
sb.append(NEW_LINE).append("\tFile:").append(bugInfo.getFilename());
sb.append(NEW_LINE).append("\tColumn:").append(Integer.toString(bugInfo.getColumn()));
sb.append(NEW_LINE).append("\tColumn:").append(Integer.toString(column > -1 ? column : 0));
sb.append(NEW_LINE).append("\tLine:").append(Integer.toString(bugInfo.getLine()));
sb.append(NEW_LINE).append("\t\tMessage:").append(bugInfo.getMessage());
sb.append(NEW_LINE).append("\t\tVariable:'").append(bugInfo.getVariable());
Expand Down

0 comments on commit a3db63b

Please sign in to comment.