Skip to content

Commit 11ccc3a

Browse files
committed
Add Clojure support
This includes comments recognition and basic metrics.
1 parent ba1c334 commit 11ccc3a

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

gitinspector/comment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
__comment__ = {"java": "//", "c": "//", "cc": "//", "cpp": "//", "cs": "//", "h": "//", "hh": "//", "hpp": "//", "hs": "--",
3333
"pl": "#", "php": "//", "py": "#", "glsl": "//", "rb": "#", "robot": "#", "rs": "//", "rlib": "//", "js": "//",
3434
"scala": "//", "sql": "--", "tex": "%", "ada": "--", "ads": "--", "adb": "--", "pot": "#", "po": "#", "go": "//",
35-
"ly": "%", "ily": "%"}
35+
"ly": "%", "ily": "%", "clj": ";", "cljs": ";", "cljc": ";"}
3636

3737
__comment_markers_must_be_at_begining__ = {"tex": True}
3838

gitinspector/extensions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
from __future__ import unicode_literals
2121

22-
DEFAULT_EXTENSIONS = ["java", "c", "cc", "cpp", "h", "hh", "hpp", "py", "glsl", "rb", "js", "sql"]
22+
DEFAULT_EXTENSIONS = ["java", "c", "cc", "cpp", "h", "hh", "hpp", "py", "glsl", "rb", "js", "sql", "clj", "cljs", "cljc"]
2323

2424
__extensions__ = DEFAULT_EXTENSIONS
2525
__located_extensions__ = set()

gitinspector/metrics.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from . import comment, filtering, interval
2525

2626
__metric_eloc__ = {"java": 500, "c": 500, "cpp": 500, "cs": 500, "h": 300, "hpp": 300, "php": 500, "py": 500, "glsl": 1000,
27-
"rb": 500, "js": 500, "sql": 1000, "xml": 1000}
27+
"rb": 500, "js": 500, "sql": 1000, "xml": 1000, "clj": 500, "cljs": 500, "cljc": 500}
2828

2929
__metric_cc_tokens__ = [[["java", "js", "c", "cc", "cpp"], ["else", r"for\s+\(.*\)", r"if\s+\(.*\)", r"case\s+\w+:",
3030
"default:", r"while\s+\(.*\)"],
@@ -33,7 +33,9 @@
3333
"default:", r"while\s+\(.*\)"],
3434
["assert", "break", "continue", "return"]],
3535
[["py"], [r"^\s+elif .*:$", r"^\s+else:$", r"^\s+for .*:", r"^\s+if .*:$", r"^\s+while .*:$"],
36-
[r"^\s+assert", "break", "continue", "return"]]]
36+
[r"^\s+assert", "break", "continue", "return"]],
37+
[["clj", "cljs", "cljs"], ["\("],
38+
["assert"]]]
3739

3840
METRIC_CYCLOMATIC_COMPLEXITY_THRESHOLD = 50
3941
METRIC_CYCLOMATIC_COMPLEXITY_DENSITY_THRESHOLD = 0.75

0 commit comments

Comments
 (0)