package org.sonar.plugins.checkstyle;
import org.sonar.api.SonarPlugin;
-
-import org.sonar.api.CoreProperties;
-import org.sonar.api.Plugin;
import org.sonar.api.Properties;
import org.sonar.api.Property;
public boolean shouldExecuteOnProject(Project project) {
return project.getFileSystem().hasJavaSourceFiles() &&
- (!profile.getActiveRulesByRepository(CheckstyleConstants.REPOSITORY_KEY).isEmpty() || project.getReuseExistingRulesConfig());
+ !profile.getActiveRulesByRepository(CheckstyleConstants.REPOSITORY_KEY).isEmpty();
}
public void analyse(Project project, SensorContext context) {
- if (project.getReuseExistingRulesConfig()) {
- Logs.INFO.warn("Reusing existing Checkstyle configuration is not supported any more.");
- }
executor.execute();
}
public boolean shouldExecuteOnProject(Project project) {
return project.getFileSystem().hasJavaSourceFiles()
- && (!profile.getActiveRulesByRepository(FindbugsConstants.REPOSITORY_KEY).isEmpty() || project.getReuseExistingRulesConfig())
+ && !profile.getActiveRulesByRepository(FindbugsConstants.REPOSITORY_KEY).isEmpty()
&& !StringUtils.equalsIgnoreCase(project.getPackaging(), "ear");
}
assertTrue(sensor.shouldExecuteOnProject(project));
}
- @Test
- public void shouldExecuteWhenReuseExistingRulesConfig() throws Exception {
- FindbugsSensor analyser = new FindbugsSensor(RulesProfile.create(), new FakeRuleFinder(), null);
- Project project = createProject();
- when(project.getReuseExistingRulesConfig()).thenReturn(true);
- assertTrue(analyser.shouldExecuteOnProject(project));
- }
-
@Test
public void shouldNotExecuteWhenNoRulesAreActive() throws Exception {
FindbugsSensor analyser = new FindbugsSensor(RulesProfile.create(), new FakeRuleFinder(), null);
}
public void analyse(Project project, SensorContext context) {
- if (project.getReuseExistingRulesConfig()) {
- Logs.INFO.warn("Reusing existing PMD configuration is not supported any more.");
- }
try {
File xmlReport = executor.execute();
getStaxParser(project, context).parse(xmlReport);
public boolean shouldExecuteOnProject(Project project) {
return project.getFileSystem().hasJavaSourceFiles() &&
- (!profile.getActiveRulesByRepository(PmdConstants.REPOSITORY_KEY).isEmpty() || project.getReuseExistingRulesConfig());
+ !profile.getActiveRulesByRepository(PmdConstants.REPOSITORY_KEY).isEmpty();
}
private PmdViolationsXmlParser getStaxParser(Project project, SensorContext context) {