@Test public void should_add_issues_from_report() { setReport("report.json"); stylelintReportSensor.execute(context); Collection<ExternalIssue> externalIssues = context.allExternalIssues(); assertThat(externalIssues).hasSize(2); Iterator<ExternalIssue> iterator = externalIssues.iterator(); ExternalIssue first = iterator.next(); ExternalIssue second = iterator.next(); assertThat(first.type()).isEqualTo(RuleType.BUG); assertThat(second.type()).isEqualTo(RuleType.CODE_SMELL); assertThat(first.remediationEffort()).isEqualTo(5); assertThat(first.severity()).isEqualTo(Severity.MAJOR); assertThat(first.primaryLocation().message()).isEqualTo("external issue message (color-no-invalid-hex)"); assertThat(first.primaryLocation().textRange().start().line()).isEqualTo(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; }