Skip to content

Commit 06e7315

Browse files
committed
commentOnlyChangedFiles
1 parent f69c8e3 commit 06e7315

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ apply from: project.buildscript.classLoader.getResource('release.gradle').toURI(
1919

2020

2121
dependencies {
22-
compile 'se.bjurr.violations:violation-comments-lib:1.95'
22+
compile 'se.bjurr.violations:violation-comments-lib:1.97'
2323
compile 'com.jayway.jsonpath:json-path:2.0.0'
2424
compile 'com.google.code.gson:gson:2.8.0'
2525
compile 'com.google.guava:guava:20.0'

src/main/java/se/bjurr/violations/comments/bitbucketserver/lib/BitbucketServerCommentsProvider.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public BitbucketServerCommentsProvider(
9292
}
9393

9494
@Override
95-
public void createCommentWithAllSingleFileComments(final String comment) {
95+
public void createComment(final String comment) {
9696
client.pullRequestComment(comment);
9797
}
9898

@@ -234,6 +234,11 @@ public boolean shouldKeepOldComments() {
234234
return violationCommentsToBitbucketApi.getShouldKeepOldComments();
235235
}
236236

237+
@Override
238+
public boolean shouldCommentOnlyChangedFiles() {
239+
return violationCommentsToBitbucketApi.getShouldCommentOnlyChangedFiles();
240+
}
241+
237242
private void removeComment(final BitbucketServerComment comment) {
238243
final Deque<BitbucketServerComment> commentStack = new ArrayDeque<>();
239244
commentStack.add(comment);

src/main/java/se/bjurr/violations/comments/bitbucketserver/lib/ViolationCommentsToBitbucketServerApi.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public void log(final Level level, final String string, final Throwable t) {
5858
}
5959
};
6060
private Integer maxNumberOfViolations;
61+
private boolean shouldCommentOnlyChangedFiles = true;
6162

6263
private ViolationCommentsToBitbucketServerApi() {}
6364

@@ -150,6 +151,10 @@ public boolean getShouldKeepOldComments() {
150151
return shouldKeepOldComments;
151152
}
152153

154+
public boolean getShouldCommentOnlyChangedFiles() {
155+
return shouldCommentOnlyChangedFiles;
156+
}
157+
153158
public String getPersonalAccessToken() {
154159
return personalAccessToken;
155160
}
@@ -283,6 +288,12 @@ public ViolationCommentsToBitbucketServerApi withShouldKeepOldComments(
283288
return this;
284289
}
285290

291+
public ViolationCommentsToBitbucketServerApi withShouldCommentOnlyChangedFiles(
292+
final boolean shouldCommentOnlyChangedFiles) {
293+
this.shouldCommentOnlyChangedFiles = shouldCommentOnlyChangedFiles;
294+
return this;
295+
}
296+
286297
public ViolationCommentsToBitbucketServerApi withProxyHostNameOrIp(
287298
final String proxyHostNameOrIp) {
288299
this.proxyHostNameOrIp = proxyHostNameOrIp;

0 commit comments

Comments
 (0)