You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@skywalking.apache.org by ke...@apache.org on 2021/02/27 13:56:45 UTC

[skywalking-eyes] branch defect/review-comment-style created (now f900417)

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

kezhenxu94 pushed a change to branch defect/review-comment-style
in repository https://gitbox.apache.org/repos/asf/skywalking-eyes.git.


      at f900417  defect: avoid crash when no comment style is found

This branch includes the following new commits:

     new f900417  defect: avoid crash when no comment style is found

The 1 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.



[skywalking-eyes] 01/01: defect: avoid crash when no comment style is found

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

kezhenxu94 pushed a commit to branch defect/review-comment-style
in repository https://gitbox.apache.org/repos/asf/skywalking-eyes.git

commit f9004170524ba80f605e010e6c64575ed1586a34
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Sat Feb 27 21:56:33 2021 +0800

    defect: avoid crash when no comment style is found
---
 pkg/review/header.go | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/pkg/review/header.go b/pkg/review/header.go
index 8b96e26..b9cae79 100644
--- a/pkg/review/header.go
+++ b/pkg/review/header.go
@@ -144,7 +144,12 @@ func Header(result *header2.Result, config *config2.Config) error {
 				logger.Log.Warnln("Failed to get blob:", changedFile.GetFilename(), changedFile.GetSHA())
 				continue
 			}
-			header, err := header2.GenerateLicenseHeader(comments2.FileCommentStyle(changedFile.GetFilename()), &config.Header)
+			style := comments2.FileCommentStyle(changedFile.GetFilename())
+			if style == nil {
+				logger.Log.Warnln("Failed to determine the comment style of file:", changedFile.GetFilename())
+				continue
+			}
+			header, err := header2.GenerateLicenseHeader(style, &config.Header)
 			if err != nil {
 				logger.Log.Warnln("Failed to generate comment header:", changedFile.GetFilename())
 				continue