private Diagnostic convertPuppetLintDiagnostic(File moduleRoot, Issue issue) { FileDiagnostic diagnostic = new FileDiagnostic( getSeverity(issue), PuppetLintService.PUPPET_LINT, issue.getMessage(), new File(getRelativePath(new File(moduleRoot, issue.getPath())))); diagnostic.setLineNumber(issue.getLineNumber()); return diagnostic; }
private static int getSeverity(Issue issue) { switch (issue.getSeverity()) { case ERROR: return Diagnostic.ERROR; default: return Diagnostic.WARNING; } }