From df642b578df073a86af2b9ffc209254b4abf690d Mon Sep 17 00:00:00 2001 From: Alexander Kradenkov Date: Tue, 5 Sep 2017 19:29:04 +0300 Subject: [PATCH] add Swift support --- gitinspector/comment.py | 6 +++--- gitinspector/metrics.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gitinspector/comment.py b/gitinspector/comment.py index c80c9e3..798d121 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": "%}", "swift": "*/"} __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": "%", "swift": "//"} __comment_markers_must_be_at_begining__ = {"tex": True} diff --git a/gitinspector/metrics.py b/gitinspector/metrics.py index 6f90ef8..d213404 100644 --- a/gitinspector/metrics.py +++ b/gitinspector/metrics.py @@ -24,7 +24,7 @@ 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, "swift": 500} __metric_cc_tokens__ = [[["java", "js", "c", "cc", "cpp"], ["else", r"for\s+\(.*\)", r"if\s+\(.*\)", r"case\s+\w+:", "default:", r"while\s+\(.*\)"],