gitinspector
gitinspector copied to clipboard
Add golang support
Fixes https://github.com/ejwa/gitinspector/pull/139
I saw the work in https://github.com/ejwa/gitinspector/pull/139 and decided to take it across the finish line.
Let me know if I did anything wrong.
Thank you. I think this is missing support for some of the statements available in Go. From the top of my head;
return { } . if statements without paranthesis. quit defer
... and there's probably more... I'm don't use Go on a regular basis, so I don't know everything in the language.
@adam-waldenberg I'm not sure where to add those statements. Is there any documentation explaining how to add support for a new language?
@CBarraford Sorry for the slow answer... Nope..there's not really any documentation... But it has been discussed previously in previous issues. Basically, metrics.py/metric_cc_tokens has entry tokens/matchstrings and exit tokens/matchstrings for each supported language or set of languages. These are just normal regular expressions.
In your changeset, ["java", "js", "c", "cc", "cpp", "go"] share one set of entry/exit tokens/matchstrings.... "go" differs slightly and adds a few things - it should probably have it's own entry in the list, much like python and csharp do.