From commits-return-3304-archive-asf-public=cust-asf.ponee.io@skywalking.apache.org Tue Mar 23 05:40:30 2021 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-he-de.apache.org (mxout1-he-de.apache.org [95.216.194.37]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 018911804BB for ; Tue, 23 Mar 2021 06:40:30 +0100 (CET) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-he-de.apache.org (ASF Mail Server at mxout1-he-de.apache.org) with SMTP id 6FE5C63623 for ; Tue, 23 Mar 2021 05:40:29 +0000 (UTC) Received: (qmail 83164 invoked by uid 500); 23 Mar 2021 05:40:28 -0000 Mailing-List: contact commits-help@skywalking.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@skywalking.apache.org Delivered-To: mailing list commits@skywalking.apache.org Received: (qmail 83155 invoked by uid 99); 23 Mar 2021 05:40:27 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Mar 2021 05:40:27 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 8633B8E947; Tue, 23 Mar 2021 05:40:27 +0000 (UTC) Date: Tue, 23 Mar 2021 05:40:27 +0000 To: "commits@skywalking.apache.org" Subject: [skywalking-eyes] branch main updated: feature: support .rst files and allow fixing header of a single file (#25) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <161647802747.11671.12028649344041764302@gitbox.apache.org> From: kezhenxu94@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: skywalking-eyes X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Oldrev: a99620b8188a00d1aaaa345783e7a691ebaac0d7 X-Git-Newrev: 6d6571432d5524368f0d302e2ca592d2cd019e6b X-Git-Rev: 6d6571432d5524368f0d302e2ca592d2cd019e6b X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. kezhenxu94 pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/skywalking-eyes.git The following commit(s) were added to refs/heads/main by this push: new 6d65714 feature: support .rst files and allow fixing header of a single file (#25) 6d65714 is described below commit 6d6571432d5524368f0d302e2ca592d2cd019e6b Author: Zhenxu Ke AuthorDate: Tue Mar 23 13:40:03 2021 +0800 feature: support .rst files and allow fixing header of a single file (#25) --- assets/languages.yaml | 1 + assets/styles.yaml | 5 +++++ commands/header_fix.go | 11 ++++++++--- pkg/license/norm.go | 1 + 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/assets/languages.yaml b/assets/languages.yaml index 8099dce..505e95f 100644 --- a/assets/languages.yaml +++ b/assets/languages.yaml @@ -6660,6 +6660,7 @@ reStructuredText: codemirror_mode: rst codemirror_mime_type: text/x-rst language_id: 419 + comment_style_id: DoubleDot sed: type: programming color: "#64b970" diff --git a/assets/styles.yaml b/assets/styles.yaml index a79eb6c..08e3fed 100644 --- a/assets/styles.yaml +++ b/assets/styles.yaml @@ -64,3 +64,8 @@ start: ';' middle: ';' end: ';' + +- id: DoubleDot + start: '..' + middle: '..' + end: '..' diff --git a/commands/header_fix.go b/commands/header_fix.go index a022636..f437c02 100644 --- a/commands/header_fix.go +++ b/commands/header_fix.go @@ -34,13 +34,18 @@ var FixCommand = &cobra.Command{ Long: "fix command walks the specified paths recursively and fix the license header if the specified files don't have the license header.", RunE: func(cmd *cobra.Command, args []string) error { var result header.Result + var errors []string + var files []string - if err := header.Check(&Config.Header, &result); err != nil { + if len(args) > 0 { + files = args + } else if err := header.Check(&Config.Header, &result); err != nil { return err + } else { + files = result.Failure } - var errors []string - for _, file := range result.Failure { + for _, file := range files { if err := header.Fix(file, &Config.Header, &result); err != nil { errors = append(errors, err.Error()) } diff --git a/pkg/license/norm.go b/pkg/license/norm.go index cc21552..f18daa1 100644 --- a/pkg/license/norm.go +++ b/pkg/license/norm.go @@ -60,6 +60,7 @@ var ( regexp.MustCompile(`(?m)^\s*-}+`), // -} regexp.MustCompile(`(?m)^\s*::`), // :: + regexp.MustCompile(`(?m)^\s*\.\.`), // .. regexp.MustCompile(`(?mi)^\s*@?REM`), // @REM }