use of org.sonar.api.config.internal.ConfigurationBridge in project sonarlint-core by SonarSource.
the class StorageFileExclusions method getExcludedFiles.
public Set<String> getExcludedFiles(String moduleKey, Collection<String> filePaths, Predicate<String> testFilePredicate) {
GlobalProperties globalProps = storageReader.readGlobalProperties();
ModuleConfiguration moduleConfig = storageReader.readModuleConfig(moduleKey);
MapSettings settings = new MapSettings();
settings.addProperties(globalProps.getProperties());
settings.addProperties(moduleConfig.getProperties());
ExclusionFilters exclusionFilters = new ExclusionFilters(new ConfigurationBridge(settings));
exclusionFilters.prepare();
return filePaths.stream().filter(filePath -> !exclusionFilters.accept(filePath, testFilePredicate.test(filePath) ? Type.TEST : Type.MAIN)).collect(Collectors.toSet());
}
Aggregations