Moved Report and ReportID to their own sub-package
This commit is contained in:
parent
be15297cc5
commit
4b101bb183
4 changed files with 12 additions and 10 deletions
|
@ -617,7 +617,7 @@ public class DetektOperation extends AbstractProcessOperation<DetektOperation> {
|
||||||
* @param reports one or more reports
|
* @param reports one or more reports
|
||||||
* @return this operation instance
|
* @return this operation instance
|
||||||
*/
|
*/
|
||||||
public DetektOperation report(DetektReport... reports) {
|
public DetektOperation report(Report... reports) {
|
||||||
report_.addAll(List.of(reports));
|
report_.addAll(List.of(reports));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package rife.bld.extension;
|
package rife.bld.extension.detekt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Defines a report for the given report-id to be stored on the given path.
|
* Defines a report for the given report-id to be stored on the given path.
|
||||||
|
@ -24,5 +24,5 @@ package rife.bld.extension;
|
||||||
* @author <a href="https://erik.thauvin.net/">Erik C. Thauvin</a>
|
* @author <a href="https://erik.thauvin.net/">Erik C. Thauvin</a>
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public record DetektReport(DetektReportId id, String path) {
|
public record Report(ReportId id, String path) {
|
||||||
}
|
}
|
|
@ -14,7 +14,7 @@
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package rife.bld.extension;
|
package rife.bld.extension.detekt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The report-id values.
|
* The report-id values.
|
||||||
|
@ -22,6 +22,6 @@ package rife.bld.extension;
|
||||||
* @author <a href="https://erik.thauvin.net/">Erik C. Thauvin</a>
|
* @author <a href="https://erik.thauvin.net/">Erik C. Thauvin</a>
|
||||||
* @since 1.0
|
* @since 1.0
|
||||||
*/
|
*/
|
||||||
public enum DetektReportId {
|
public enum ReportId {
|
||||||
TXT, XML, HTML, MD, SARIF
|
TXT, XML, HTML, MD, SARIF
|
||||||
}
|
}
|
|
@ -20,6 +20,8 @@ import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import rife.bld.BaseProject;
|
import rife.bld.BaseProject;
|
||||||
import rife.bld.blueprints.BaseProjectBlueprint;
|
import rife.bld.blueprints.BaseProjectBlueprint;
|
||||||
|
import rife.bld.extension.detekt.Report;
|
||||||
|
import rife.bld.extension.detekt.ReportId;
|
||||||
import rife.bld.operations.exceptions.ExitStatusException;
|
import rife.bld.operations.exceptions.ExitStatusException;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -147,11 +149,11 @@ class DetektOperationTest {
|
||||||
var op = new DetektOperation()
|
var op = new DetektOperation()
|
||||||
.fromProject(new BaseProjectBlueprint(new File("examples"), "com.example",
|
.fromProject(new BaseProjectBlueprint(new File("examples"), "com.example",
|
||||||
"Example"))
|
"Example"))
|
||||||
.report(new DetektReport(DetektReportId.HTML, html.getAbsolutePath()))
|
.report(new Report(ReportId.HTML, html.getAbsolutePath()))
|
||||||
.report(new DetektReport(DetektReportId.XML, xml.getAbsolutePath()))
|
.report(new Report(ReportId.XML, xml.getAbsolutePath()))
|
||||||
.report(new DetektReport(DetektReportId.TXT, txt.getAbsolutePath()))
|
.report(new Report(ReportId.TXT, txt.getAbsolutePath()))
|
||||||
.report(new DetektReport(DetektReportId.MD, md.getAbsolutePath()))
|
.report(new Report(ReportId.MD, md.getAbsolutePath()))
|
||||||
.report(new DetektReport(DetektReportId.SARIF, sarif.getAbsolutePath()));
|
.report(new Report(ReportId.SARIF, sarif.getAbsolutePath()));
|
||||||
|
|
||||||
assertThatThrownBy(op::execute).isInstanceOf(ExitStatusException.class);
|
assertThatThrownBy(op::execute).isInstanceOf(ExitStatusException.class);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue