gitinspector icon indicating copy to clipboard operation
gitinspector copied to clipboard

Add golang support

Open cbarraford opened this issue 8 years ago • 3 comments

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.

cbarraford avatar Mar 07 '17 12:03 cbarraford

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 avatar Mar 09 '17 01:03 adam-waldenberg

@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 avatar Mar 09 '17 16:03 cbarraford

@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.

adam-waldenberg avatar Mar 17 '17 06:03 adam-waldenberg