use of org.sonar.api.profiles.ProfileDefinition in project sonarqube by SonarSource.
the class RegisterQualityProfiles method profilesByLanguage.
/**
* @return profiles by language
*/
private ListMultimap<String, RulesProfile> profilesByLanguage() {
ListMultimap<String, RulesProfile> byLang = ArrayListMultimap.create();
for (ProfileDefinition definition : definitions) {
ValidationMessages validation = ValidationMessages.create();
RulesProfile profile = definition.createProfile(validation);
validation.log(LOGGER);
if (profile != null && !validation.hasErrors()) {
byLang.put(StringUtils.lowerCase(profile.getLanguage()), profile);
}
}
return byLang;
}
use of org.sonar.api.profiles.ProfileDefinition in project sonarlint-core by SonarSource.
the class StandaloneActiveRulesProvider method profilesByLanguage.
private static ListMultimap<String, RulesProfile> profilesByLanguage(ProfileDefinition[] profileDefinitions) {
ListMultimap<String, RulesProfile> byLang = ArrayListMultimap.create();
for (ProfileDefinition definition : profileDefinitions) {
ValidationMessages validation = ValidationMessages.create();
RulesProfile profile = definition.createProfile(validation);
if (profile != null && !validation.hasErrors()) {
byLang.put(StringUtils.lowerCase(profile.getLanguage()), profile);
}
}
return byLang;
}
use of org.sonar.api.profiles.ProfileDefinition in project sonarqube by SonarSource.
the class QProfileReset method loadDefinitionsGroupedByName.
private ListMultimap<QProfileName, RulesProfile> loadDefinitionsGroupedByName(String language) {
ListMultimap<QProfileName, RulesProfile> profilesByName = ArrayListMultimap.create();
for (ProfileDefinition definition : definitions) {
ValidationMessages validation = ValidationMessages.create();
RulesProfile profile = definition.createProfile(validation);
if (language.equals(profile.getLanguage())) {
processValidationMessages(validation);
profilesByName.put(new QProfileName(profile.getLanguage(), profile.getName()), profile);
}
}
return profilesByName;
}
Aggregations