use of org.sonar.check.BelongsToProfile in project sonarqube by SonarSource.
the class AnnotationProfileParser method parse.
public RulesProfile parse(String repositoryKey, String profileName, String language, Collection<Class> annotatedClasses, ValidationMessages messages) {
RulesProfile profile = RulesProfile.create(profileName, language);
for (Class<?> aClass : annotatedClasses) {
BelongsToProfile belongsToProfile = aClass.getAnnotation(BelongsToProfile.class);
addRule(aClass, belongsToProfile, profile, repositoryKey, messages);
}
return profile;
}
use of org.sonar.check.BelongsToProfile in project sonarqube by SonarSource.
the class BuiltInQualityProfileAnnotationLoader method loadActiveRule.
void loadActiveRule(BuiltInQualityProfilesDefinition.NewBuiltInQualityProfile profile, String repositoryKey, Class<?> clazz) {
BelongsToProfile belongsToProfile = clazz.getAnnotation(BelongsToProfile.class);
if ((belongsToProfile != null) && StringUtils.equals(belongsToProfile.title(), profile.name())) {
String ruleKey = RuleAnnotationUtils.getRuleKey(clazz);
NewBuiltInActiveRule activeRule = profile.activateRule(repositoryKey, ruleKey);
activeRule.overrideSeverity(belongsToProfile.priority().name());
}
}
Aggregations