forked from TouK/sputnik
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementation of TouK#113 Plugin Facility for Sputnik Processors
- Loading branch information
1 parent
416263e
commit c40da0d
Showing
11 changed files
with
174 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/main/java/pl/touk/sputnik/processor/ReviewProcessorFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package pl.touk.sputnik.processor; | ||
|
||
import pl.touk.sputnik.configuration.Configuration; | ||
import pl.touk.sputnik.review.ReviewProcessor; | ||
|
||
public interface ReviewProcessorFactory<T extends ReviewProcessor> { | ||
|
||
boolean isEnabled(Configuration aConfiguration); | ||
|
||
T create(Configuration aConfiguration); | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/pl/touk/sputnik/processor/checkstyle/CheckstyleReviewProcessorFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package pl.touk.sputnik.processor.checkstyle; | ||
|
||
import pl.touk.sputnik.configuration.Configuration; | ||
import pl.touk.sputnik.configuration.GeneralOption; | ||
import pl.touk.sputnik.processor.ReviewProcessorFactory; | ||
|
||
public class CheckstyleReviewProcessorFactory implements ReviewProcessorFactory<CheckstyleProcessor> { | ||
|
||
@Override | ||
public boolean isEnabled(Configuration aConfiguration) { | ||
return Boolean.valueOf(aConfiguration.getProperty(GeneralOption.CHECKSTYLE_ENABLED)); | ||
} | ||
|
||
@Override | ||
public CheckstyleProcessor create(Configuration aConfiguration) { | ||
return new CheckstyleProcessor(aConfiguration); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/pl/touk/sputnik/processor/codenarc/NodeCardReviewProcessorFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package pl.touk.sputnik.processor.codenarc; | ||
|
||
import pl.touk.sputnik.configuration.Configuration; | ||
import pl.touk.sputnik.configuration.GeneralOption; | ||
import pl.touk.sputnik.processor.ReviewProcessorFactory; | ||
|
||
public class NodeCardReviewProcessorFactory implements ReviewProcessorFactory<CodeNarcProcessor> { | ||
|
||
@Override | ||
public boolean isEnabled(Configuration aConfiguration) { | ||
return Boolean.valueOf(aConfiguration.getProperty(GeneralOption.CODE_NARC_ENABLED)); | ||
} | ||
|
||
@Override | ||
public CodeNarcProcessor create(Configuration aConfiguration) { | ||
return new CodeNarcProcessor(aConfiguration); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/pl/touk/sputnik/processor/findbugs/FindbugsReviewProcessorFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package pl.touk.sputnik.processor.findbugs; | ||
|
||
import pl.touk.sputnik.configuration.Configuration; | ||
import pl.touk.sputnik.configuration.GeneralOption; | ||
import pl.touk.sputnik.processor.ReviewProcessorFactory; | ||
|
||
public class FindbugsReviewProcessorFactory implements ReviewProcessorFactory<FindBugsProcessor> { | ||
|
||
@Override | ||
public boolean isEnabled(Configuration aConfiguration) { | ||
return Boolean.valueOf(aConfiguration.getProperty(GeneralOption.FINDBUGS_ENABLED)); | ||
} | ||
|
||
@Override | ||
public FindBugsProcessor create(Configuration aConfiguration) { | ||
return new FindBugsProcessor(aConfiguration); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/pl/touk/sputnik/processor/jshint/JsHintReviewProcessorFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package pl.touk.sputnik.processor.jshint; | ||
|
||
import pl.touk.sputnik.configuration.Configuration; | ||
import pl.touk.sputnik.configuration.GeneralOption; | ||
import pl.touk.sputnik.processor.ReviewProcessorFactory; | ||
|
||
public class JsHintReviewProcessorFactory implements ReviewProcessorFactory<JsHintProcessor> { | ||
|
||
@Override | ||
public boolean isEnabled(Configuration aConfiguration) { | ||
return Boolean.valueOf(aConfiguration.getProperty(GeneralOption.JSHINT_ENABLED)); | ||
} | ||
|
||
@Override | ||
public JsHintProcessor create(Configuration aConfiguration) { | ||
return new JsHintProcessor(aConfiguration); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/pl/touk/sputnik/processor/jslint/JsLintReviewProcessorFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package pl.touk.sputnik.processor.jslint; | ||
|
||
import pl.touk.sputnik.configuration.Configuration; | ||
import pl.touk.sputnik.configuration.GeneralOption; | ||
import pl.touk.sputnik.processor.ReviewProcessorFactory; | ||
|
||
public class JsLintReviewProcessorFactory implements ReviewProcessorFactory<JsLintProcessor> { | ||
|
||
@Override | ||
public boolean isEnabled(Configuration aConfiguration) { | ||
return Boolean.valueOf(aConfiguration.getProperty(GeneralOption.JSLINT_ENABLED)); | ||
} | ||
|
||
@Override | ||
public JsLintProcessor create(Configuration aConfiguration) { | ||
return new JsLintProcessor(aConfiguration); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/pl/touk/sputnik/processor/pmd/PmdReviewProcessorFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package pl.touk.sputnik.processor.pmd; | ||
|
||
import pl.touk.sputnik.configuration.Configuration; | ||
import pl.touk.sputnik.configuration.GeneralOption; | ||
import pl.touk.sputnik.processor.ReviewProcessorFactory; | ||
|
||
public class PmdReviewProcessorFactory implements ReviewProcessorFactory<PmdProcessor> { | ||
|
||
@Override | ||
public boolean isEnabled(Configuration aConfiguration) { | ||
return Boolean.valueOf(aConfiguration.getProperty(GeneralOption.PMD_ENABLED)); | ||
} | ||
|
||
@Override | ||
public PmdProcessor create(Configuration aConfiguration) { | ||
return new PmdProcessor(aConfiguration); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/pl/touk/sputnik/processor/scalastyle/ScalastyleReviewProcessorFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package pl.touk.sputnik.processor.scalastyle; | ||
|
||
import pl.touk.sputnik.configuration.Configuration; | ||
import pl.touk.sputnik.configuration.GeneralOption; | ||
import pl.touk.sputnik.processor.ReviewProcessorFactory; | ||
|
||
public class ScalastyleReviewProcessorFactory implements ReviewProcessorFactory<ScalastyleProcessor> { | ||
|
||
@Override | ||
public boolean isEnabled(Configuration aConfiguration) { | ||
return Boolean.valueOf(aConfiguration.getProperty(GeneralOption.SCALASTYLE_ENABLED)); | ||
} | ||
|
||
@Override | ||
public ScalastyleProcessor create(Configuration aConfiguration) { | ||
return new ScalastyleProcessor(aConfiguration); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/pl/touk/sputnik/processor/sonar/SonarReviewProcessorFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package pl.touk.sputnik.processor.sonar; | ||
|
||
import pl.touk.sputnik.configuration.Configuration; | ||
import pl.touk.sputnik.configuration.GeneralOption; | ||
import pl.touk.sputnik.processor.ReviewProcessorFactory; | ||
|
||
public class SonarReviewProcessorFactory implements ReviewProcessorFactory<SonarProcessor> { | ||
|
||
@Override | ||
public boolean isEnabled(Configuration aConfiguration) { | ||
return Boolean.valueOf(aConfiguration.getProperty(GeneralOption.SONAR_ENABLED)); | ||
} | ||
|
||
@Override | ||
public SonarProcessor create(Configuration aConfiguration) { | ||
return new SonarProcessor(aConfiguration); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/resources/META-INF/services/pl.touk.sputnik.processor.ReviewProcessorFactory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
pl.touk.sputnik.processor.checkstyle.CheckstyleReviewProcessorFactory | ||
pl.touk.sputnik.processor.pmd.PmdReviewProcessorFactory | ||
pl.touk.sputnik.processor.findbugs.FindbugsReviewProcessorFactory | ||
pl.touk.sputnik.processor.scalastyle.ScalastyleReviewProcessorFactory | ||
pl.touk.sputnik.processor.codenarc.NodeCardReviewProcessorFactory | ||
pl.touk.sputnik.processor.jslint.JsLintReviewProcessorFactory | ||
pl.touk.sputnik.processor.jshint.JsHintReviewProcessorFactory | ||
pl.touk.sputnik.processor.sonar.SonarReviewProcessorFactory |