private RulesProfile loadProvidedProfile(String name, String filename) { try { InputStream sonarWayProfile = getClass().getResourceAsStream(filename); RulesProfile profile = new RulesProfile(name); // TODO set as mandatory into the RulesProfile constructor profile.setLanguage(Languages.JAVA.getKey()); profile.setActiveRules(importConfiguration(IOUtils.toString(sonarWayProfile), getInitialReferential())); return profile; } catch (IOException e) { throw new RuntimeException("Configuration file not found for the profile : " + name, e); } }
private RulesProfile loadProvidedProfile(String name, String filename) { try { InputStream sonarWayProfile = getClass().getResourceAsStream(filename); RulesProfile profile = new RulesProfile(name); profile.setActiveRules(importConfiguration(IOUtils.toString(sonarWayProfile), getInitialReferential())); return profile; } catch (IOException e) { throw new RuntimeException("Configuration file not found for the profile : " + name, e); } }
public String exportConfiguration(RulesProfile activeProfile) { Module tree = buildModuleTree(activeProfile.getActiveRulesByPlugin(CheckstylePlugin.KEY)); String xmlModules = buildXmlFromModuleTree(tree); return addHeaderToXml(xmlModules); }
public String exportConfiguration(RulesProfile activeProfile) { Ruleset tree = buildModuleTree(activeProfile.getActiveRulesByPlugin(PmdPlugin.KEY)); String xmlModules = buildXmlFromModuleTree(tree); return addHeaderToXml(xmlModules); }