You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by li...@apache.org on 2024/05/07 04:09:51 UTC

(incubator-answer-plugins) branch main updated (8b772dc -> 6ef8913)

This is an automated email from the ASF dual-hosted git repository.

linkinstar pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-answer-plugins.git


    from 8b772dc  chore(plugins): update version
     new 136b274  feat(review): delete old review logic
     new f6f2faa  feat(review): delete log
     new dd81ee2  fix(review): fix bug
     new c54bf86  fix(review): keyword space check
     new 6ef8913  chore(plugins): update version

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 reviewer-basic/basic.go | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)


(incubator-answer-plugins) 05/05: chore(plugins): update version

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

linkinstar pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-answer-plugins.git

commit 6ef89130aa723035ad8e600da971eb0c0d8acef8
Author: LinkinStars <li...@foxmail.com>
AuthorDate: Tue May 7 12:07:47 2024 +0800

    chore(plugins): update version
---
 reviewer-basic/basic.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/reviewer-basic/basic.go b/reviewer-basic/basic.go
index 04f33c5..ed484f5 100644
--- a/reviewer-basic/basic.go
+++ b/reviewer-basic/basic.go
@@ -52,7 +52,7 @@ func (r *Reviewer) Info() plugin.Info {
 		SlugName:    "basic_reviewer",
 		Description: plugin.MakeTranslator(i18n.InfoDescription),
 		Author:      "answerdev",
-		Version:     "1.0.1",
+		Version:     "1.0.2",
 		Link:        "https://github.com/apache/incubator-answer-plugins/tree/main/reviewer-basic",
 	}
 }


(incubator-answer-plugins) 02/05: feat(review): delete log

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

linkinstar pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-answer-plugins.git

commit f6f2faabb4799eda9728dd0b3556d8745231cfba
Author: kumfo <ku...@sifou.com>
AuthorDate: Tue May 7 11:20:12 2024 +0800

    feat(review): delete log
---
 reviewer-basic/basic.go | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/reviewer-basic/basic.go b/reviewer-basic/basic.go
index c91cc59..6726f29 100644
--- a/reviewer-basic/basic.go
+++ b/reviewer-basic/basic.go
@@ -89,8 +89,7 @@ func (r *Reviewer) Review(content *plugin.ReviewContent) (result *plugin.ReviewR
 
 	keywords := strings.Split(r.Config.PostReviewKeywords, "\n")
 	disallowedKeywords := strings.Split(r.Config.PostDisallowedKeywords, "\n")
-	log.Error(keywords)
-	log.Error(disallowedKeywords)
+
 	// Check if the post contains the keywords that need review
 	for _, keyword := range keywords {
 		keyword = strings.ToLower(keyword)


(incubator-answer-plugins) 04/05: fix(review): keyword space check

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

linkinstar pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-answer-plugins.git

commit c54bf862f9a56c9e6668161ce4a28218cd326753
Author: kumfo <ku...@sifou.com>
AuthorDate: Tue May 7 11:49:17 2024 +0800

    fix(review): keyword space check
---
 reviewer-basic/basic.go | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/reviewer-basic/basic.go b/reviewer-basic/basic.go
index 4cca222..04f33c5 100644
--- a/reviewer-basic/basic.go
+++ b/reviewer-basic/basic.go
@@ -90,6 +90,10 @@ func (r *Reviewer) Review(content *plugin.ReviewContent) (result *plugin.ReviewR
 
 	// Check if the post contains the keywords that need review
 	for _, keyword := range keywords {
+		keyword = strings.TrimSpace(keyword)
+		if len(keyword) == 0 {
+			continue
+		}
 		keyword = strings.ToLower(keyword)
 		if strings.Contains(strings.ToLower(content.Title), keyword) ||
 			strings.Contains(strings.ToLower(content.Content), keyword) ||
@@ -106,6 +110,10 @@ func (r *Reviewer) Review(content *plugin.ReviewContent) (result *plugin.ReviewR
 
 	// If the post contains the disallowed keywords
 	for _, disallowedKeyword := range disallowedKeywords {
+		disallowedKeyword = strings.TrimSpace(disallowedKeyword)
+		if len(disallowedKeyword) == 0 {
+			continue
+		}
 		disallowedKeyword = strings.ToLower(disallowedKeyword)
 		if strings.Contains(strings.ToLower(content.Title), disallowedKeyword) ||
 			strings.Contains(strings.ToLower(content.Content), disallowedKeyword) ||


(incubator-answer-plugins) 01/05: feat(review): delete old review logic

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

linkinstar pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-answer-plugins.git

commit 136b2740c648ff68207556d30961899090a355c8
Author: kumfo <ku...@sifou.com>
AuthorDate: Tue May 7 11:18:53 2024 +0800

    feat(review): delete old review logic
---
 reviewer-basic/basic.go | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/reviewer-basic/basic.go b/reviewer-basic/basic.go
index fe90e82..c91cc59 100644
--- a/reviewer-basic/basic.go
+++ b/reviewer-basic/basic.go
@@ -123,10 +123,7 @@ func (r *Reviewer) Review(content *plugin.ReviewContent) (result *plugin.ReviewR
 		}
 	}
 
-	return &plugin.ReviewResult{
-		Approved: false,
-		Reason:   plugin.TranslateWithData(myI18n.Language(content.Language), i18n.CommentNeedReview, nil),
-	}
+	return result
 }
 
 func (r *Reviewer) ConfigFields() []plugin.ConfigField {


(incubator-answer-plugins) 03/05: fix(review): fix bug

Posted by li...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

linkinstar pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-answer-plugins.git

commit dd81ee26903ed00b8636f0c3c3420f40d797701b
Author: kumfo <ku...@sifou.com>
AuthorDate: Tue May 7 11:18:53 2024 +0800

    fix(review): fix bug
---
 reviewer-basic/basic.go | 2 --
 1 file changed, 2 deletions(-)

diff --git a/reviewer-basic/basic.go b/reviewer-basic/basic.go
index 6726f29..4cca222 100644
--- a/reviewer-basic/basic.go
+++ b/reviewer-basic/basic.go
@@ -24,8 +24,6 @@ import (
 	"fmt"
 	"strings"
 
-	"github.com/segmentfault/pacman/log"
-
 	"github.com/apache/incubator-answer-plugins/reviewer-basic/i18n"
 	"github.com/apache/incubator-answer/plugin"
 	myI18n "github.com/segmentfault/pacman/i18n"