This repository has been archived by the owner on May 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a73f57
commit d961025
Showing
12 changed files
with
159 additions
and
27 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
21 changes: 21 additions & 0 deletions
21
...cker-core/src/main/java/uk/gov/justice/raml/maven/lintchecker/LintCheckConfiguration.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 |
---|---|---|
@@ -1,9 +1,30 @@ | ||
package uk.gov.justice.raml.maven.lintchecker; | ||
|
||
import uk.gov.justice.raml.maven.lintchecker.rules.LintCheckRule; | ||
|
||
import org.apache.maven.plugin.logging.Log; | ||
import org.apache.maven.project.MavenProject; | ||
|
||
/** | ||
* Contains any configuration needed by any of the {@link LintCheckRule}s. Currently this class | ||
* contains nothing, but to future proof the {@link LintCheckRule} interface we pass this class | ||
* in the execute() method. Add any configuration your rule may need here. | ||
*/ | ||
public class LintCheckConfiguration { | ||
|
||
private final MavenProject mavenProject; | ||
private final Log log; | ||
|
||
public LintCheckConfiguration(final MavenProject mavenProject, final Log log) { | ||
this.mavenProject = mavenProject; | ||
this.log = log; | ||
} | ||
|
||
public MavenProject getMavenProject() { | ||
return mavenProject; | ||
} | ||
|
||
public Log getLog() { | ||
return log; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...hecker-core/src/main/java/uk/gov/justice/raml/maven/lintchecker/LintCheckerException.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 |
---|---|---|
@@ -1,11 +1,29 @@ | ||
package uk.gov.justice.raml.maven.lintchecker; | ||
|
||
import uk.gov.justice.raml.maven.lintchecker.rules.LintCheckRule; | ||
|
||
/** | ||
* Exception that is thrown if any of the {@link LintCheckRule}s fail. | ||
*/ | ||
public class LintCheckerException extends Exception { | ||
|
||
public LintCheckerException() { | ||
super(); | ||
} | ||
|
||
public LintCheckerException(final String message) { | ||
super(message); | ||
} | ||
|
||
public LintCheckerException(final String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
public LintCheckerException(final Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
protected LintCheckerException(final String message, final Throwable cause, final boolean enableSuppression, final boolean writableStackTrace) { | ||
super(message, cause, enableSuppression, writableStackTrace); | ||
} | ||
} |
5 changes: 4 additions & 1 deletion
5
...raml/maven/lintchecker/LintCheckRule.java → ...aven/lintchecker/rules/LintCheckRule.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
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
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
56 changes: 56 additions & 0 deletions
56
.../src/main/java/uk/gov/justice/raml/maven/lintchecker/processor/LintCheckerGoalConfig.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,56 @@ | ||
package uk.gov.justice.raml.maven.lintchecker.processor; | ||
|
||
import uk.gov.justice.raml.maven.lintchecker.rules.LintCheckRule; | ||
|
||
import java.io.File; | ||
import java.util.List; | ||
|
||
import org.apache.maven.plugin.logging.Log; | ||
import org.apache.maven.project.MavenProject; | ||
|
||
public class LintCheckerGoalConfig { | ||
private final File sourceDirectory; | ||
private final List<LintCheckRule> rules; | ||
private final List<String> includes; | ||
private final List<String> excludes; | ||
private final MavenProject currentProject; | ||
private final Log log; | ||
|
||
public LintCheckerGoalConfig(final File sourceDirectory, | ||
final List<LintCheckRule> rules, | ||
final List<String> includes, | ||
final List<String> excludes, | ||
final MavenProject currentProject, | ||
final Log log) { | ||
this.sourceDirectory = sourceDirectory; | ||
this.rules = rules; | ||
this.includes = includes; | ||
this.excludes = excludes; | ||
this.currentProject = currentProject; | ||
this.log = log; | ||
} | ||
|
||
public File getSourceDirectory() { | ||
return sourceDirectory; | ||
} | ||
|
||
public List<LintCheckRule> getRules() { | ||
return rules; | ||
} | ||
|
||
public List<String> getIncludes() { | ||
return includes; | ||
} | ||
|
||
public List<String> getExcludes() { | ||
return excludes; | ||
} | ||
|
||
public MavenProject getCurrentProject() { | ||
return currentProject; | ||
} | ||
|
||
public Log getLog() { | ||
return log; | ||
} | ||
} |
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
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
1 change: 0 additions & 1 deletion
1
...lugin/src/test/java/uk/gov/justice/raml/maven/lintchecker/rules/FailingLintCheckRule.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
4 changes: 3 additions & 1 deletion
4
.../maven/lintchecker/LintCheckMojoTest.java → .../lintchecker/rules/LintCheckMojoTest.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
1 change: 0 additions & 1 deletion
1
...in/src/test/java/uk/gov/justice/raml/maven/lintchecker/rules/SucceedingLintCheckRule.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