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/07/09 12:10:21 UTC

[skywalking-eyes] branch main updated: Add support for Twig template language (#39)

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 7d41533  Add support for Twig template language (#39)
7d41533 is described below

commit 7d41533a0657b40d23ee0b8e6ef07a6a93353338
Author: emschu <pr...@mailbox.org>
AuthorDate: Fri Jul 9 14:10:01 2021 +0200

    Add support for Twig template language (#39)
    
    * add header comment configuration for Twig template language
    
    * add CurlyBracketHashtag to header normalizing mechanism
---
 assets/languages.yaml | 1 +
 assets/styles.yaml    | 5 +++++
 pkg/license/norm.go   | 2 ++
 3 files changed, 8 insertions(+)

diff --git a/assets/languages.yaml b/assets/languages.yaml
index 4b0c75c..0804a62 100644
--- a/assets/languages.yaml
+++ b/assets/languages.yaml
@@ -5783,6 +5783,7 @@ Twig:
   codemirror_mode: twig
   codemirror_mime_type: text/x-twig
   language_id: 377
+  comment_style_id: CurlyBracketHashtag
 Type Language:
   type: data
   aliases:
diff --git a/assets/styles.yaml b/assets/styles.yaml
index 98fddc6..9d70bba 100644
--- a/assets/styles.yaml
+++ b/assets/styles.yaml
@@ -80,6 +80,11 @@
   middle: '%'
   end: '%'
 
+- id: CurlyBracketHashtag
+  start: '{#'
+  middle: ~
+  end: '#}'
+
 - id: CurlyBracketAsterisk
   start: '{*'
   middle: ~
diff --git a/pkg/license/norm.go b/pkg/license/norm.go
index 90ee00f..75fd1ab 100644
--- a/pkg/license/norm.go
+++ b/pkg/license/norm.go
@@ -67,6 +67,8 @@ var (
 		regexp.MustCompile(`(?m)^\s*\.\.`),   // ..
 		regexp.MustCompile(`(?mi)^\s*@?REM`), // @REM
 		regexp.MustCompile(`(?mi)^\s*%+`),    // % e.g. matlab
+		regexp.MustCompile(`(?m)^\s*{#+`),    // {#
+		regexp.MustCompile(`(?m)^\s*#+}`),    // #}
 		regexp.MustCompile(`(?m)^\s*{\*+`),   // {*
 		regexp.MustCompile(`(?m)^\s*\*+}`),   // *}
 	}