Search in sources :

Example 1 with RuleKey

use of org.sonarsource.sonarlint.core.client.api.common.RuleKey in project sonarlint-core by SonarSource.

the class StandaloneSonarLintEngineImpl method identifyActiveRules.

private Collection<ActiveRule> identifyActiveRules(StandaloneAnalysisConfiguration configuration) {
    Set<String> excludedRules = configuration.excludedRules().stream().map(RuleKey::toString).collect(toSet());
    Set<String> includedRules = configuration.includedRules().stream().map(RuleKey::toString).filter(r -> !excludedRules.contains(r)).collect(toSet());
    Collection<SonarLintRuleDefinition> filteredActiveRules = new ArrayList<>();
    filteredActiveRules.addAll(allRulesDefinitionsByKey.values().stream().filter(SonarLintRuleDefinition::isActiveByDefault).filter(isExcludedByConfiguration(excludedRules)).collect(Collectors.toList()));
    filteredActiveRules.addAll(allRulesDefinitionsByKey.values().stream().filter(r -> !r.isActiveByDefault()).filter(isIncludedByConfiguration(includedRules)).collect(Collectors.toList()));
    return filteredActiveRules.stream().map(rd -> {
        var activeRule = new ActiveRule(rd.getKey(), rd.getLanguage().getLanguageKey());
        Map<String, String> effectiveParams = new HashMap<>(rd.getDefaultParams());
        Optional.ofNullable(configuration.ruleParameters().get(RuleKey.parse(rd.getKey()))).ifPresent(effectiveParams::putAll);
        activeRule.setParams(effectiveParams);
        return activeRule;
    }).collect(Collectors.toList());
}
Also used : ClientLogOutput(org.sonarsource.sonarlint.core.commons.log.ClientLogOutput) AnalysisResults(org.sonarsource.sonarlint.core.analysis.api.AnalysisResults) DefaultClientIssue(org.sonarsource.sonarlint.core.client.api.common.analysis.DefaultClientIssue) Configuration(org.sonarsource.sonarlint.core.plugin.commons.PluginInstancesRepository.Configuration) HashMap(java.util.HashMap) StandaloneRuleDetails(org.sonarsource.sonarlint.core.client.api.standalone.StandaloneRuleDetails) SonarLintRuleDefinition(org.sonarsource.sonarlint.core.rule.extractor.SonarLintRuleDefinition) AnalysisEngine(org.sonarsource.sonarlint.core.analysis.AnalysisEngine) AnalyzeCommand(org.sonarsource.sonarlint.core.analysis.command.AnalyzeCommand) ArrayList(java.util.ArrayList) IssueListener(org.sonarsource.sonarlint.core.client.api.common.analysis.IssueListener) StandaloneGlobalConfiguration(org.sonarsource.sonarlint.core.client.api.standalone.StandaloneGlobalConfiguration) Map(java.util.Map) Objects.requireNonNull(java.util.Objects.requireNonNull) Nullable(javax.annotation.Nullable) ActiveRule(org.sonarsource.sonarlint.core.analysis.api.ActiveRule) StandaloneSonarLintEngine(org.sonarsource.sonarlint.core.client.api.standalone.StandaloneSonarLintEngine) Collectors.toSet(java.util.stream.Collectors.toSet) AnalysisConfiguration(org.sonarsource.sonarlint.core.analysis.api.AnalysisConfiguration) Predicate(java.util.function.Predicate) PluginInstancesRepository(org.sonarsource.sonarlint.core.plugin.commons.PluginInstancesRepository) Collection(java.util.Collection) PluginDetails(org.sonarsource.sonarlint.core.client.api.common.PluginDetails) Set(java.util.Set) ClientProgressMonitor(org.sonarsource.sonarlint.core.commons.progress.ClientProgressMonitor) Collectors(java.util.stream.Collectors) StandaloneRule(org.sonarsource.sonarlint.core.container.standalone.rule.StandaloneRule) StandaloneAnalysisConfiguration(org.sonarsource.sonarlint.core.client.api.standalone.StandaloneAnalysisConfiguration) SonarLintWrappedException(org.sonarsource.sonarlint.core.client.api.exceptions.SonarLintWrappedException) AnalysisEngineConfiguration(org.sonarsource.sonarlint.core.analysis.api.AnalysisEngineConfiguration) RuleKey(org.sonarsource.sonarlint.core.client.api.common.RuleKey) Optional(java.util.Optional) ProgressMonitor(org.sonarsource.sonarlint.core.commons.progress.ProgressMonitor) SonarLintRuleDefinition(org.sonarsource.sonarlint.core.rule.extractor.SonarLintRuleDefinition) RuleKey(org.sonarsource.sonarlint.core.client.api.common.RuleKey) ActiveRule(org.sonarsource.sonarlint.core.analysis.api.ActiveRule) ArrayList(java.util.ArrayList) HashMap(java.util.HashMap) Map(java.util.Map)

Example 2 with RuleKey

use of org.sonarsource.sonarlint.core.client.api.common.RuleKey in project sonarlint-core by SonarSource.

the class StandaloneIssueMediumTests method simpleJavaWithIncludedRulesUsingDeprecatedKey.

@Test
void simpleJavaWithIncludedRulesUsingDeprecatedKey() throws Exception {
    var inputFile = prepareInputFile(A_JAVA_FILE_PATH, "import java.util.Optional;\n" + "public class Foo {\n" + "  public void foo(Optional<String> name) {  // for squid:3553, not in Sonar Way\n" + "    int x;\n" + "    System.out.println(\"Foo\" + name.isPresent());\n" + "  }\n" + "}", false);
    final Collection<RuleKey> includedRules = singleton(new RuleKey("squid", "S3553"));
    List<String> logs = new CopyOnWriteArrayList<>();
    final List<Issue> issues = new ArrayList<>();
    sonarlint.analyze(StandaloneAnalysisConfiguration.builder().setBaseDir(baseDir.toPath()).addInputFile(inputFile).addIncludedRules(includedRules).build(), issues::add, (msg, lvl) -> logs.add(msg), null);
    assertThat(issues).extracting(Issue::getRuleKey, Issue::getStartLine, i -> i.getInputFile().relativePath(), Issue::getSeverity).containsOnly(tuple("java:S3553", 3, A_JAVA_FILE_PATH, "MAJOR"), tuple("java:S106", 5, A_JAVA_FILE_PATH, "MAJOR"), tuple("java:S1220", null, A_JAVA_FILE_PATH, "MINOR"), tuple("java:S1481", 4, A_JAVA_FILE_PATH, "MINOR"));
    assertThat(logs).contains("Rule 'java:S3553' was included using its deprecated key 'squid:S3553'. Please fix your configuration.");
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Language(org.sonarsource.sonarlint.core.commons.Language) Disabled(org.junit.jupiter.api.Disabled) StandaloneSonarLintEngineImpl(org.sonarsource.sonarlint.core.StandaloneSonarLintEngineImpl) AfterAll(org.junit.jupiter.api.AfterAll) Future(java.util.concurrent.Future) Collections.singleton(java.util.Collections.singleton) BeforeAll(org.junit.jupiter.api.BeforeAll) Map(java.util.Map) Path(java.nio.file.Path) EnumSet(java.util.EnumSet) Collection(java.util.Collection) Set(java.util.Set) StandardCharsets(java.nio.charset.StandardCharsets) Executors(java.util.concurrent.Executors) StandaloneAnalysisConfiguration(org.sonarsource.sonarlint.core.client.api.standalone.StandaloneAnalysisConfiguration) Test(org.junit.jupiter.api.Test) List(java.util.List) TempDir(org.junit.jupiter.api.io.TempDir) Issue(org.sonarsource.sonarlint.core.client.api.common.analysis.Issue) ComponentContainer(org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer) PluginLocator(org.sonarsource.sonarlint.core.util.PluginLocator) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) Assertions.fail(org.junit.jupiter.api.Assertions.fail) HashMap(java.util.HashMap) TestUtils(testutils.TestUtils) ArrayList(java.util.ArrayList) SonarLintModuleFileSystem(org.sonarsource.sonarlint.core.analysis.sonarapi.SonarLintModuleFileSystem) Charset(java.nio.charset.Charset) StandaloneGlobalConfiguration(org.sonarsource.sonarlint.core.client.api.standalone.StandaloneGlobalConfiguration) OnDiskTestClientInputFile(testutils.OnDiskTestClientInputFile) Assumptions.assumeTrue(org.junit.jupiter.api.Assumptions.assumeTrue) Nullable(javax.annotation.Nullable) ClientModuleInfo(org.sonarsource.sonarlint.core.analysis.api.ClientModuleInfo) Files(java.nio.file.Files) RuleDetails(org.sonarsource.sonarlint.core.client.api.common.RuleDetails) Assertions.tuple(org.assertj.core.api.Assertions.tuple) SystemUtils(org.apache.commons.lang3.SystemUtils) ClientInputFile(org.sonarsource.sonarlint.core.analysis.api.ClientInputFile) ClientFileSystemFixtures.aClientFileSystemWith(org.sonarsource.sonarlint.core.client.api.common.ClientFileSystemFixtures.aClientFileSystemWith) IOException(java.io.IOException) FileUtils(org.apache.commons.io.FileUtils) Assertions.entry(org.assertj.core.api.Assertions.entry) File(java.io.File) ExecutionException(java.util.concurrent.ExecutionException) Paths(java.nio.file.Paths) RuleKey(org.sonarsource.sonarlint.core.client.api.common.RuleKey) Collections(java.util.Collections) NodeJsHelper(org.sonarsource.sonarlint.core.NodeJsHelper) Issue(org.sonarsource.sonarlint.core.client.api.common.analysis.Issue) RuleKey(org.sonarsource.sonarlint.core.client.api.common.RuleKey) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) ArrayList(java.util.ArrayList) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) Test(org.junit.jupiter.api.Test)

Example 3 with RuleKey

use of org.sonarsource.sonarlint.core.client.api.common.RuleKey in project sonarlint-core by SonarSource.

the class StandaloneIssueMediumTests method simpleJavaWithExcludedRules.

@Test
void simpleJavaWithExcludedRules() throws Exception {
    var inputFile = prepareInputFile(A_JAVA_FILE_PATH, "public class Foo {\n" + "  public void foo() {\n" + "    int x;\n" + "    System.out.println(\"Foo\");\n" + "  }\n" + "}", false);
    final Collection<RuleKey> excludedRules = singleton(new RuleKey("java", "S106"));
    final List<Issue> issues = new ArrayList<>();
    sonarlint.analyze(StandaloneAnalysisConfiguration.builder().setBaseDir(baseDir.toPath()).addInputFile(inputFile).addExcludedRules(excludedRules).build(), issues::add, null, null);
    assertThat(issues).extracting(Issue::getRuleKey, Issue::getStartLine, i -> i.getInputFile().relativePath(), Issue::getSeverity).containsOnly(tuple("java:S1220", null, A_JAVA_FILE_PATH, "MINOR"), tuple("java:S1481", 3, A_JAVA_FILE_PATH, "MINOR"));
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Language(org.sonarsource.sonarlint.core.commons.Language) Disabled(org.junit.jupiter.api.Disabled) StandaloneSonarLintEngineImpl(org.sonarsource.sonarlint.core.StandaloneSonarLintEngineImpl) AfterAll(org.junit.jupiter.api.AfterAll) Future(java.util.concurrent.Future) Collections.singleton(java.util.Collections.singleton) BeforeAll(org.junit.jupiter.api.BeforeAll) Map(java.util.Map) Path(java.nio.file.Path) EnumSet(java.util.EnumSet) Collection(java.util.Collection) Set(java.util.Set) StandardCharsets(java.nio.charset.StandardCharsets) Executors(java.util.concurrent.Executors) StandaloneAnalysisConfiguration(org.sonarsource.sonarlint.core.client.api.standalone.StandaloneAnalysisConfiguration) Test(org.junit.jupiter.api.Test) List(java.util.List) TempDir(org.junit.jupiter.api.io.TempDir) Issue(org.sonarsource.sonarlint.core.client.api.common.analysis.Issue) ComponentContainer(org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer) PluginLocator(org.sonarsource.sonarlint.core.util.PluginLocator) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) Assertions.fail(org.junit.jupiter.api.Assertions.fail) HashMap(java.util.HashMap) TestUtils(testutils.TestUtils) ArrayList(java.util.ArrayList) SonarLintModuleFileSystem(org.sonarsource.sonarlint.core.analysis.sonarapi.SonarLintModuleFileSystem) Charset(java.nio.charset.Charset) StandaloneGlobalConfiguration(org.sonarsource.sonarlint.core.client.api.standalone.StandaloneGlobalConfiguration) OnDiskTestClientInputFile(testutils.OnDiskTestClientInputFile) Assumptions.assumeTrue(org.junit.jupiter.api.Assumptions.assumeTrue) Nullable(javax.annotation.Nullable) ClientModuleInfo(org.sonarsource.sonarlint.core.analysis.api.ClientModuleInfo) Files(java.nio.file.Files) RuleDetails(org.sonarsource.sonarlint.core.client.api.common.RuleDetails) Assertions.tuple(org.assertj.core.api.Assertions.tuple) SystemUtils(org.apache.commons.lang3.SystemUtils) ClientInputFile(org.sonarsource.sonarlint.core.analysis.api.ClientInputFile) ClientFileSystemFixtures.aClientFileSystemWith(org.sonarsource.sonarlint.core.client.api.common.ClientFileSystemFixtures.aClientFileSystemWith) IOException(java.io.IOException) FileUtils(org.apache.commons.io.FileUtils) Assertions.entry(org.assertj.core.api.Assertions.entry) File(java.io.File) ExecutionException(java.util.concurrent.ExecutionException) Paths(java.nio.file.Paths) RuleKey(org.sonarsource.sonarlint.core.client.api.common.RuleKey) Collections(java.util.Collections) NodeJsHelper(org.sonarsource.sonarlint.core.NodeJsHelper) Issue(org.sonarsource.sonarlint.core.client.api.common.analysis.Issue) RuleKey(org.sonarsource.sonarlint.core.client.api.common.RuleKey) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) ArrayList(java.util.ArrayList) Test(org.junit.jupiter.api.Test)

Example 4 with RuleKey

use of org.sonarsource.sonarlint.core.client.api.common.RuleKey in project sonarlint-core by SonarSource.

the class StandaloneAnalysisConfigurationTests method testToString_and_getters.

@Test
void testToString_and_getters(@TempDir Path temp) throws Exception {
    Map<String, String> props = new HashMap<>();
    props.put("sonar.java.libraries", "foo bar");
    final var srcFile1 = createDirectory(temp.resolve("src1"));
    final var srcFile2 = createDirectory(temp.resolve("src2"));
    final var srcFile3 = createDirectory(temp.resolve("src3"));
    ClientInputFile inputFile = new TestClientInputFile(temp, srcFile1, false, StandardCharsets.UTF_8, null);
    ClientInputFile inputFileWithLanguage = new TestClientInputFile(temp, srcFile2, false, StandardCharsets.UTF_8, Language.JAVA);
    ClientInputFile testInputFile = new TestClientInputFile(temp, srcFile3, true, null, Language.PHP);
    var baseDir = createDirectory(temp.resolve("baseDir"));
    Collection<RuleKey> excludedRules = Arrays.asList(new RuleKey("squid", "S1135"), new RuleKey("squid", "S1181"));
    Collection<RuleKey> includedRules = Arrays.asList(new RuleKey("javascript", "S2424"), new RuleKey("javascript", "S1442"));
    Map<String, String> squidS5Parameters = new HashMap<>();
    squidS5Parameters.put("s5param1", "s5value1");
    squidS5Parameters.put("s5param2", "s5value2");
    Map<String, String> squidS6Parameters = new HashMap<>();
    squidS6Parameters.put("s6param1", "s6value1");
    squidS6Parameters.put("s6param2", "s6value2");
    Map<RuleKey, Map<String, String>> ruleParameters = new HashMap<>();
    ruleParameters.put(RuleKey.parse("squid:S6"), squidS6Parameters);
    var config = StandaloneAnalysisConfiguration.builder().setBaseDir(baseDir).addInputFile(inputFile).addInputFiles(inputFileWithLanguage).addInputFiles(Arrays.asList(testInputFile)).putAllExtraProperties(props).putExtraProperty("sonar.foo", "bar").addExcludedRules(excludedRules).addExcludedRule(RuleKey.parse("squid:S1")).addExcludedRules(RuleKey.parse("squid:S2"), RuleKey.parse("squid:S3")).addIncludedRules(includedRules).addIncludedRule(RuleKey.parse("squid:I1")).addIncludedRules(RuleKey.parse("squid:I2"), RuleKey.parse("squid:I3")).addRuleParameter(RuleKey.parse("squid:S4"), "param1", "value1").addRuleParameters(RuleKey.parse("squid:S5"), squidS5Parameters).addRuleParameters(ruleParameters).build();
    assertThat(config.toString()).isEqualTo("[\n" + "  baseDir: " + baseDir.toString() + "\n" + "  extraProperties: {sonar.java.libraries=foo bar, sonar.foo=bar}\n" + "  moduleKey: null\n" + "  excludedRules: [squid:S1135, squid:S1181, squid:S1, squid:S2, squid:S3]\n" + "  includedRules: [javascript:S2424, javascript:S1442, squid:I1, squid:I2, squid:I3]\n" + "  ruleParameters: {squid:S4={param1=value1}, squid:S5={s5param1=s5value1, s5param2=s5value2}, squid:S6={s6param1=s6value1, s6param2=s6value2}}\n" + "  inputFiles: [\n" + "    " + srcFile1.toUri().toString() + " (UTF-8)\n" + "    " + srcFile2.toUri().toString() + " (UTF-8) [java]\n" + "    " + srcFile3.toUri().toString() + " (default) [test] [php]\n" + "  ]\n" + "]\n");
    assertThat(config.baseDir()).isEqualTo(baseDir);
    assertThat(config.inputFiles()).containsExactly(inputFile, inputFileWithLanguage, testInputFile);
    assertThat(config.extraProperties()).containsExactly(entry("sonar.java.libraries", "foo bar"), entry("sonar.foo", "bar"));
    assertThat(config.excludedRules()).extracting(RuleKey::toString).containsExactly("squid:S1135", "squid:S1181", "squid:S1", "squid:S2", "squid:S3");
    assertThat(config.includedRules()).extracting(RuleKey::toString).containsExactly("javascript:S2424", "javascript:S1442", "squid:I1", "squid:I2", "squid:I3");
    assertThat(config.ruleParameters()).containsKeys(RuleKey.parse("squid:S4"), RuleKey.parse("squid:S5"), RuleKey.parse("squid:S6"));
}
Also used : HashMap(java.util.HashMap) RuleKey(org.sonarsource.sonarlint.core.client.api.common.RuleKey) ClientInputFile(org.sonarsource.sonarlint.core.analysis.api.ClientInputFile) TestClientInputFile(testutils.TestClientInputFile) TestClientInputFile(testutils.TestClientInputFile) HashMap(java.util.HashMap) Map(java.util.Map) Test(org.junit.jupiter.api.Test)

Example 5 with RuleKey

use of org.sonarsource.sonarlint.core.client.api.common.RuleKey in project sonarlint-core by SonarSource.

the class StandaloneIssueMediumTests method simpleJavaWithIncludedRules.

@Test
void simpleJavaWithIncludedRules() throws Exception {
    var inputFile = prepareInputFile(A_JAVA_FILE_PATH, "import java.util.Optional;\n" + "public class Foo {\n" + "  public void foo(Optional<String> name) {  // for squid:3553, not in Sonar Way\n" + "    int x;\n" + "    System.out.println(\"Foo\" + name.isPresent());\n" + "  }\n" + "}", false);
    final Collection<RuleKey> includedRules = singleton(new RuleKey("java", "S3553"));
    final List<Issue> issues = new ArrayList<>();
    sonarlint.analyze(StandaloneAnalysisConfiguration.builder().setBaseDir(baseDir.toPath()).addInputFile(inputFile).addIncludedRules(includedRules).build(), issues::add, null, null);
    assertThat(issues).extracting(Issue::getRuleKey, Issue::getStartLine, i -> i.getInputFile().relativePath(), Issue::getSeverity).containsOnly(tuple("java:S3553", 3, A_JAVA_FILE_PATH, "MAJOR"), tuple("java:S106", 5, A_JAVA_FILE_PATH, "MAJOR"), tuple("java:S1220", null, A_JAVA_FILE_PATH, "MINOR"), tuple("java:S1481", 4, A_JAVA_FILE_PATH, "MINOR"));
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) Language(org.sonarsource.sonarlint.core.commons.Language) Disabled(org.junit.jupiter.api.Disabled) StandaloneSonarLintEngineImpl(org.sonarsource.sonarlint.core.StandaloneSonarLintEngineImpl) AfterAll(org.junit.jupiter.api.AfterAll) Future(java.util.concurrent.Future) Collections.singleton(java.util.Collections.singleton) BeforeAll(org.junit.jupiter.api.BeforeAll) Map(java.util.Map) Path(java.nio.file.Path) EnumSet(java.util.EnumSet) Collection(java.util.Collection) Set(java.util.Set) StandardCharsets(java.nio.charset.StandardCharsets) Executors(java.util.concurrent.Executors) StandaloneAnalysisConfiguration(org.sonarsource.sonarlint.core.client.api.standalone.StandaloneAnalysisConfiguration) Test(org.junit.jupiter.api.Test) List(java.util.List) TempDir(org.junit.jupiter.api.io.TempDir) Issue(org.sonarsource.sonarlint.core.client.api.common.analysis.Issue) ComponentContainer(org.sonarsource.sonarlint.core.plugin.commons.pico.ComponentContainer) PluginLocator(org.sonarsource.sonarlint.core.util.PluginLocator) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) Assertions.fail(org.junit.jupiter.api.Assertions.fail) HashMap(java.util.HashMap) TestUtils(testutils.TestUtils) ArrayList(java.util.ArrayList) SonarLintModuleFileSystem(org.sonarsource.sonarlint.core.analysis.sonarapi.SonarLintModuleFileSystem) Charset(java.nio.charset.Charset) StandaloneGlobalConfiguration(org.sonarsource.sonarlint.core.client.api.standalone.StandaloneGlobalConfiguration) OnDiskTestClientInputFile(testutils.OnDiskTestClientInputFile) Assumptions.assumeTrue(org.junit.jupiter.api.Assumptions.assumeTrue) Nullable(javax.annotation.Nullable) ClientModuleInfo(org.sonarsource.sonarlint.core.analysis.api.ClientModuleInfo) Files(java.nio.file.Files) RuleDetails(org.sonarsource.sonarlint.core.client.api.common.RuleDetails) Assertions.tuple(org.assertj.core.api.Assertions.tuple) SystemUtils(org.apache.commons.lang3.SystemUtils) ClientInputFile(org.sonarsource.sonarlint.core.analysis.api.ClientInputFile) ClientFileSystemFixtures.aClientFileSystemWith(org.sonarsource.sonarlint.core.client.api.common.ClientFileSystemFixtures.aClientFileSystemWith) IOException(java.io.IOException) FileUtils(org.apache.commons.io.FileUtils) Assertions.entry(org.assertj.core.api.Assertions.entry) File(java.io.File) ExecutionException(java.util.concurrent.ExecutionException) Paths(java.nio.file.Paths) RuleKey(org.sonarsource.sonarlint.core.client.api.common.RuleKey) Collections(java.util.Collections) NodeJsHelper(org.sonarsource.sonarlint.core.NodeJsHelper) Issue(org.sonarsource.sonarlint.core.client.api.common.analysis.Issue) RuleKey(org.sonarsource.sonarlint.core.client.api.common.RuleKey) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) ArrayList(java.util.ArrayList) Test(org.junit.jupiter.api.Test)

Aggregations

RuleKey (org.sonarsource.sonarlint.core.client.api.common.RuleKey)9 ArrayList (java.util.ArrayList)8 HashMap (java.util.HashMap)8 Map (java.util.Map)8 Test (org.junit.jupiter.api.Test)8 Collection (java.util.Collection)7 Set (java.util.Set)7 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)7 Nullable (javax.annotation.Nullable)7 ClientInputFile (org.sonarsource.sonarlint.core.analysis.api.ClientInputFile)7 File (java.io.File)6 IOException (java.io.IOException)6 Charset (java.nio.charset.Charset)6 StandardCharsets (java.nio.charset.StandardCharsets)6 Files (java.nio.file.Files)6 Path (java.nio.file.Path)6 Paths (java.nio.file.Paths)6 Collections (java.util.Collections)6 Collections.singleton (java.util.Collections.singleton)6 EnumSet (java.util.EnumSet)6