@Test public void should_skip_duplicates() throws Exception { setReport("report.json"); new StylelintReportSensor(CHECK_FACTORY_WITH_RULE).execute(context); Collection<ExternalIssue> externalIssues = context.allExternalIssues(); assertThat(externalIssues).hasSize(1); assertThat(externalIssues.iterator().next().primaryLocation().message()).isEqualTo("external issue message (comment-no-empty)"); assertThat(logTester.logs(LoggerLevel.DEBUG)) .contains("Stylelint issue for rule 'color-no-invalid-hex' is skipped because this rule is activated in your SonarQube profile for CSS (rule key in SQ css:S4647)"); }
@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; }