-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementation of #113 Plugin Facility for Sputnik Processors #131
Merged
Merged
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
537ad67
Implementation of #113 Plugin Facility for Sputnik Processors
mirkosertic c209b20
Implementation of #113 Plugin Facility for Sputnik Processors
1c37bef
Implementation of #113 Plugin Facility for Sputnik Processors
b4d0f02
Implementation of #113 Plugin Facility for Sputnik Processors
efb1291
Implemented #130
mirkosertic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just use configuration instead of aConfiguration. Here and in implemented classes. |
||
|
||
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd change variable names to match other variables style, so: serviceLoader instead of theLoader, iterator instead of theIterator, reviewProcessorFactory instead of theFactory etc.