From f3b1981ebf4cd06609345a1faeabe677118c1f0a Mon Sep 17 00:00:00 2001 From: Rostislav Svoboda Date: Thu, 12 Apr 2018 12:56:16 +0200 Subject: [PATCH] [#108] Simplified comment message to make the main issue more visible --- .../ViolationsReportAsCommentBuilder.java | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/core/src/main/java/org/jboss/jbossset/bugclerk/comments/ViolationsReportAsCommentBuilder.java b/core/src/main/java/org/jboss/jbossset/bugclerk/comments/ViolationsReportAsCommentBuilder.java index 317b815..1c7d543 100644 --- a/core/src/main/java/org/jboss/jbossset/bugclerk/comments/ViolationsReportAsCommentBuilder.java +++ b/core/src/main/java/org/jboss/jbossset/bugclerk/comments/ViolationsReportAsCommentBuilder.java @@ -25,13 +25,10 @@ import static org.jboss.jbossset.bugclerk.utils.StringUtils.formatCheckname; import static org.jboss.jbossset.bugclerk.utils.StringUtils.twoEOLs; -import java.text.SimpleDateFormat; import java.util.ArrayList; -import java.util.Calendar; import java.util.Collection; import java.util.HashMap; import java.util.List; -import java.util.Locale; import java.util.Map; import java.util.stream.Collectors; @@ -44,17 +41,8 @@ public class ViolationsReportAsCommentBuilder { - private static final String NOW = new SimpleDateFormat("yyyy/MM/dd - HH:mm", Locale.getDefault()).format(Calendar - .getInstance().getTime()); - - private static final String BUGCLERK_ISSUES_TRACKER = "https://github.com/jboss-set/bug-clerk/issues"; - - private static final String COMMENT_MESSSAGE_HEADER = BugClerk.class.getSimpleName() + " (automated tool) noticed on " - + NOW + " the following" + " discrepencies in this entry:" + twoEOLs(); - - private static final String COMMENT_MESSAGE_FOOTER = "If the issues reported are erronous " - + "or if you wish to ask for enhancement or new checks for " + BugClerk.class.getSimpleName() - + " please, fill an issue on BugClerk issue tracker: " + BUGCLERK_ISSUES_TRACKER; + private static final String COMMENT_MESSAGE_FOOTER = BugClerk.class.getSimpleName() + + " (automated tool) lives at this address: https://github.com/jboss-set/bug-clerk"; public Map reportViolationToBugTracker(Collection candidates) { Map commentsToAddToIssues = new HashMap(); @@ -77,7 +65,7 @@ private Comment buildCommentReportIfNotAlreadyReported(Candidate candidate) { private Comment buildReportComment(List newViolationToReport) { if (!newViolationToReport.isEmpty()) - return new Comment(messageBody(newViolationToReport, new StringBuffer(COMMENT_MESSSAGE_HEADER)).append( + return new Comment(messageBody(newViolationToReport, new StringBuffer()).append( COMMENT_MESSAGE_FOOTER).toString(), true); return null; }