@Test public void should_support_absolute_file_paths_in_report() throws Exception { String report = "[\n" + " {\n" + " \"source\": \"%s\",\n" + " \"warnings\": [\n" + " {\n" + " \"line\": 1,\n" + " \"rule\": \"color\\-no\\-invalid-hex\",\n" + " \"text\": \"external issue message\"\n" + " }\n" + " ]\n" + " }\n" + "]\n"; File reportFile = tmpDir.newFile(); FileWriter writer = new FileWriter(reportFile); writer.write(String.format(report, inputFile.absolutePath())); writer.close(); setReport(reportFile.getAbsolutePath()); stylelintReportSensor.execute(context); assertThat(context.allExternalIssues()).hasSize(1); }
@Override public void execute(SensorContext context) { List<File> reportFiles = ExternalReportProvider.getReportFiles(context, CssPlugin.STYLELINT_REPORT_PATHS); reportFiles.forEach(report -> importReport(report, context)); }
StylelintReportSensor implements Sensor { @Override public void execute(SensorContext context) { List<File> reportFiles = ExternalReportProvider.getReportFiles(context, CssPlugin.STYLELINT_REPORT_PATHS); reportFiles.forEach(report -> importReport(report, context)); } }
StylelintReportSensor implements Sensor { @Override public void execute(SensorContext context) { List<File> reportFiles = ExternalReportProvider.getReportFiles(context, CssPlugin.STYLELINT_REPORT_PATHS); reportFiles.forEach(report -> importReport(report, context)); } StylelintReportSensor(CheckFactory checkFactory); }
StylelintReportSensor implements Sensor { @Override public void execute(SensorContext context) { List<File> reportFiles = ExternalReportProvider.getReportFiles(context, CssPlugin.STYLELINT_REPORT_PATHS); reportFiles.forEach(report -> importReport(report, context)); } StylelintReportSensor(CheckFactory checkFactory); @Override void describe(SensorDescriptor descriptor); @Override void execute(SensorContext context); static ExternalRuleLoader getStylelintRuleLoader(); }
StylelintReportSensor implements Sensor { @Override public void execute(SensorContext context) { List<File> reportFiles = ExternalReportProvider.getReportFiles(context, CssPlugin.STYLELINT_REPORT_PATHS); reportFiles.forEach(report -> importReport(report, context)); } StylelintReportSensor(CheckFactory checkFactory); @Override void describe(SensorDescriptor descriptor); @Override void execute(SensorContext context); static ExternalRuleLoader getStylelintRuleLoader(); static final String STYLELINT; }