diff --git a/README.md b/README.md index f551bd9..e998967 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,7 @@ task violationCommentsToGitLab(type: se.bjurr.violations.comments.gitlab.plugin. projectId = System.properties['GITLAB_PROJECTID']; commentOnlyChangedContent = true; + commentOnlyChangedContentContext = 0; createCommentWithAllSingleFileComments = true; createSingleFileComments = true; keepOldComments = false; diff --git a/src/main/java/se/bjurr/violations/comments/gitlab/plugin/gradle/ViolationCommentsToGitLabTask.java b/src/main/java/se/bjurr/violations/comments/gitlab/plugin/gradle/ViolationCommentsToGitLabTask.java index be1728f..14e4b40 100644 --- a/src/main/java/se/bjurr/violations/comments/gitlab/plugin/gradle/ViolationCommentsToGitLabTask.java +++ b/src/main/java/se/bjurr/violations/comments/gitlab/plugin/gradle/ViolationCommentsToGitLabTask.java @@ -24,6 +24,7 @@ public class ViolationCommentsToGitLabTask extends DefaultTask { private List> violations = new ArrayList<>(); private boolean commentOnlyChangedContent = true; + private int commentOnlyChangedContentContext = 0; private boolean commentOnlyChangedFiles = true; private boolean createCommentWithAllSingleFileComments = true; private boolean createSingleFileComments = true; @@ -54,6 +55,10 @@ public void setCommentOnlyChangedContent(final boolean commentOnlyChangedContent this.commentOnlyChangedContent = commentOnlyChangedContent; } + public void setCommentOnlyChangedContentContext(final int commentOnlyChangedContentContext) { + this.commentOnlyChangedContentContext = commentOnlyChangedContentContext; + } + public void setCreateCommentWithAllSingleFileComments( final boolean createCommentWithAllSingleFileComments) { this.createCommentWithAllSingleFileComments = createCommentWithAllSingleFileComments; @@ -195,6 +200,7 @@ public void log(final Level level, final String string, final Throwable t) { .setApiToken(this.apiToken) .setTokenType(tokenType) .setCommentOnlyChangedContent(this.commentOnlyChangedContent) // + .setCommentOnlyChangedContentContext(this.commentOnlyChangedContentContext) // .withShouldCommentOnlyChangedFiles(this.commentOnlyChangedFiles) // .setCreateCommentWithAllSingleFileComments( this.createCommentWithAllSingleFileComments) // diff --git a/violation-comments-to-gitlab-gradle-plugin-example/build.gradle b/violation-comments-to-gitlab-gradle-plugin-example/build.gradle index 1f52971..705a05d 100644 --- a/violation-comments-to-gitlab-gradle-plugin-example/build.gradle +++ b/violation-comments-to-gitlab-gradle-plugin-example/build.gradle @@ -17,6 +17,7 @@ task violationCommentsToGitLab(type: se.bjurr.violations.comments.gitlab.plugin. projectId = System.properties['GITLAB_PROJECTID']; commentOnlyChangedContent = true; + commentOnlyChangedContentContext = 0; createCommentWithAllSingleFileComments = true; createSingleFileComments = true; keepOldComments = false;