Skip to content

Commit

Permalink
commentOnlyChangedFiles
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasbjerre committed Jun 16, 2019
1 parent 41188ff commit 6c5992b
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Changelog of Violation comments to gitlab lib.
## Unreleased
### No issue

**Gradle 5**


[41188ff96a35e6d](https://github.com/tomasbjerre/violation-comments-to-gitlab-lib/commit/41188ff96a35e6d) Tomas Bjerre *2019-06-12 19:39:14*

**doc**


Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ apply from: project.buildscript.classLoader.getResource('release.gradle').toURI(


dependencies {
compile 'se.bjurr.violations:violation-comments-lib:1.95'
compile 'se.bjurr.violations:violation-comments-lib:1.97'
compile 'org.gitlab4j:gitlab4j-api:4.9.18'
testCompile 'junit:junit:4.12'
testCompile 'org.assertj:assertj-core:2.3.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ private Map<String, Object> getProxyConfig(final ViolationCommentsToGitLabApi ap
}

@Override
public void createCommentWithAllSingleFileComments(final String comment) {
public void createComment(final String comment) {
markMergeRequestAsWIP();
try {
this.gitLabApi
Expand Down Expand Up @@ -308,4 +308,9 @@ public Integer getMaxNumberOfViolations() {
public Integer getMaxCommentSize() {
return api.getMaxCommentSize();
}

@Override
public boolean shouldCommentOnlyChangedFiles() {
return api.getShouldCommentOnlyChangedFiles();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public void log(final Level level, final String string, final Throwable t) {
private String proxyPassword;
private Integer maxNumberOfViolations;
private Integer maxCommentSize;
private boolean shouldCommentOnlyChangedFiles = true;

public ViolationCommentsToGitLabApi setViolationsLogger(final ViolationsLogger violationsLogger) {
this.violationsLogger = violationsLogger;
Expand Down Expand Up @@ -148,6 +149,10 @@ public boolean getCommentOnlyChangedContent() {
return commentOnlyChangedContent;
}

public boolean getShouldCommentOnlyChangedFiles() {
return shouldCommentOnlyChangedFiles;
}

public boolean getCreateCommentWithAllSingleFileComments() {
return createCommentWithAllSingleFileComments;
}
Expand Down Expand Up @@ -190,6 +195,12 @@ public ViolationCommentsToGitLabApi setShouldKeepOldComments(
return this;
}

public ViolationCommentsToGitLabApi withShouldCommentOnlyChangedFiles(
final boolean shouldCommentOnlyChangedFiles) {
this.shouldCommentOnlyChangedFiles = shouldCommentOnlyChangedFiles;
return this;
}

public boolean getShouldKeepOldComments() {
return shouldKeepOldComments;
}
Expand Down

0 comments on commit 6c5992b

Please sign in to comment.