Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add golang support #145

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cbarraford
Copy link

Fixes #139

I saw the work in #139 and decided to take it across the finish line.

Let me know if I did anything wrong.

@adam-waldenberg
Copy link
Member

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.

@cbarraford
Copy link
Author

@adam-waldenberg I'm not sure where to add those statements. Is there any documentation explaining how to add support for a new language?

@adam-waldenberg
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants