if (foundErrorCount > 0 || foundWarningCount > 0) { LintClient client = driver.getClient(); File baselineFile = getFile(); getDisplayPath(project, baselineFile)); client.report(new Context(driver, project, project, baselineFile), IssueRegistry.BASELINE, int fixedCount = getFixedCount(); if (fixedCount > 0 && !(writeOnClose && removeFixed)) { LintClient client = driver.getClient(); File baselineFile = getFile(); + "been fixed?", fixedCount, getDisplayPath(project, baselineFile)); client.report(new Context(driver, project, project, baselineFile), IssueRegistry.BASELINE,
private static void writeAttribute(Writer writer, int indent, String name, String value) throws IOException { writer.write('\n'); indent(writer, indent); writer.write(name); writer.write('='); writer.write('"'); writer.write(XmlUtils.toXmlAttributeValue(value)); writer.write('"'); }
LintBaseline baseline = null; if (baselineFile != null) { baseline = new LintBaseline(this, baselineFile); driver.setBaseline(baseline); if (flags.isRemoveFixedBaselineIssues()) { baseline.setWriteOnClose(true); baseline.setRemoveFixed(true); int fixedCount = 0; if (baseline != null) { baselineErrorCount = baseline.getFoundErrorCount(); baselineWarningCount = baseline.getFoundWarningCount(); fixedCount = baseline.getFixedCount();
baseline.getFoundErrorCount()); baselineWarningCount = Math.max(baselineWarningCount, baseline.getFoundWarningCount()); fixedCount = Math.max(fixedCount, baseline.getFixedCount());
File baselineFile = mainConfiguration.getBaselineFile(); if (baselineFile != null) { baseline = new LintBaseline(client, baselineFile); Project lastProject = Iterables.getLast(projects); Project main = request.getMainProject(lastProject); baseline.reportBaselineIssues(this, main);
/** * Checks whether the given warning (of the given issue type, message and location) * is present in this baseline, and if so marks it as used such that a second call will * not find it. * <p> * When issue analysis is done you can call {@link #getFoundErrorCount()} and * {@link #getFoundWarningCount()} to get a count of the warnings or errors that were * matched during the run, and {@link #getFixedCount()} to get a count of the issues * that were present in the baseline that were not matched (e.g. have been fixed.) * * @param issue the issue type * @param location the location of the error * @param message the exact error message (in {@link TextFormat#RAW} format) * @param severity the severity of the issue, used to count baseline match as error or warning * @param project the relevant project, if any * @return true if this error was found in the baseline and marked as used, and false if this * issue is not part of the baseline */ public boolean findAndMark(@NonNull Issue issue, @NonNull Location location, @NonNull String message, @Nullable Severity severity, @Nullable Project project) { boolean found = findAndMark(issue, location, message, severity); if (writeOnClose && (!removeFixed || found)) { //noinspection VariableNotUsedInsideIf if (entriesToWrite != null) { entriesToWrite.add(new ReportedEntry(issue, project, location, message)); } } return found; }
for (Entry entry : entries) { if (entry.issueId.equals(issueId)) { if (isSamePathSuffix(path, entry.path)) {
boolean filtered = baseline.findAndMark(issue, location, message, severity, context.getProject()); if (filtered) {