se.bjurr.violations.comments.lib.CommentsProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of violation-comments-lib Show documentation
Show all versions of violation-comments-lib Show documentation
Library that adds violation comments from static code analysis to pull requests.
package se.bjurr.violations.comments.lib;
import java.util.List;
import java.util.Optional;
import se.bjurr.violations.comments.lib.model.ChangedFile;
import se.bjurr.violations.comments.lib.model.Comment;
public interface CommentsProvider {
/**
* Creates a comment.
*
* @param string The comment.
*/
void createComment(String string);
/**
* Create a discussion on the diff on the line the violation occurred.
*
* @param file The file in which the violation occurred.
* @param line The line number after the patch.
* @param comment The text of the comment.
*/
void createSingleFileComment(ChangedFile file, Integer line, String comment);
List getComments();
List getFiles();
void removeComments(List comments);
boolean shouldComment(ChangedFile changedFile, Integer line);
boolean shouldCreateCommentWithAllSingleFileComments();
boolean shouldCreateSingleFileComment();
boolean shouldKeepOldComments();
boolean shouldCommentOnlyChangedFiles();
Optional findCommentTemplate();
Integer getMaxNumberOfViolations();
Integer getMaxCommentSize();
}