From e58bf96d1aedb0987c38b004ebc467c912a67d99 Mon Sep 17 00:00:00 2001 From: Chuck Durfee Date: Mon, 17 Apr 2017 10:40:47 -0600 Subject: [PATCH] add Groovy support, copying Java syntax --- gitinspector/comment.py | 6 +++--- gitinspector/metrics.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gitinspector/comment.py b/gitinspector/comment.py index 2df26d1..02ec7e2 100644 --- a/gitinspector/comment.py +++ b/gitinspector/comment.py @@ -22,17 +22,17 @@ from __future__ import unicode_literals __comment_begining__ = {"java": "/*", "c": "/*", "cc": "/*", "cpp": "/*", "cs": "/*", "h": "/*", "hh": "/*", "hpp": "/*", "hs": "{-", "html": "", "php": "/*", "py": "\"\"\"", "glsl": "*/", "rb": "=end", "js": "*/", "jspx": "-->", "scala": "*/", "sql": "*/", "tex": "\\end{comment}", "xhtml": "-->", "xml": "-->", "ml": "*)", "mli": "*)", - "go": "*/", "ly": "%}", "ily": "%}"} + "go": "*/", "ly": "%}", "ily": "%}", "groovy": "*/"} __comment__ = {"java": "//", "c": "//", "cc": "//", "cpp": "//", "cs": "//", "h": "//", "hh": "//", "hpp": "//", "hs": "--", "pl": "#", "php": "//", "py": "#", "glsl": "//", "rb": "#", "robot": "#", "rs": "//", "rlib": "//", "js": "//", "scala": "//", "sql": "--", "tex": "%", "ada": "--", "ads": "--", "adb": "--", "pot": "#", "po": "#", "go": "//", - "ly": "%", "ily": "%"} + "ly": "%", "ily": "%", "groovy": "//"} __comment_markers_must_be_at_begining__ = {"tex": True} diff --git a/gitinspector/metrics.py b/gitinspector/metrics.py index d4aeead..a404bdc 100644 --- a/gitinspector/metrics.py +++ b/gitinspector/metrics.py @@ -24,9 +24,9 @@ from .changes import FileDiff from . import comment, filtering, interval __metric_eloc__ = {"java": 500, "c": 500, "cpp": 500, "cs": 500, "h": 300, "hpp": 300, "php": 500, "py": 500, "glsl": 1000, - "rb": 500, "js": 500, "sql": 1000, "xml": 1000} + "rb": 500, "js": 500, "sql": 1000, "xml": 1000, "groovy": 500} -__metric_cc_tokens__ = [[["java", "js", "c", "cc", "cpp"], ["else", r"for\s+\(.*\)", r"if\s+\(.*\)", r"case\s+\w+:", +__metric_cc_tokens__ = [[["java", "js", "c", "cc", "cpp","groovy"], ["else", r"for\s+\(.*\)", r"if\s+\(.*\)", r"case\s+\w+:", "default:", r"while\s+\(.*\)"], ["assert", "break", "continue", "return"]], [["cs"], ["else", r"for\s+\(.*\)", r"foreach\s+\(.*\)", r"goto\s+\w+:", r"if\s+\(.*\)", r"case\s+\w+:",