-
Notifications
You must be signed in to change notification settings - Fork 60
Fix CLOC metric #146
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
Fix CLOC metric #146
Conversation
958d1ae to
3718430
Compare
| String | DQUOTE | DQUOTE2 | ExpressionStatement | Block | Module => {} | ||
| Comment => { | ||
| stats.comment_lines.insert(start); | ||
| stats.comment_lines += (end - start) + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you probably need to handle the case of multiline comments:
https://twitter.com/gvanrossum/status/112670605505077248
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a FIXME in the Python test because I don't know how to discriminate a string used as comment from a simple string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An idea could be to look for string where the parent is an ExpressionStatement. I'd say that in the case the string is the statement and so this the only thing we've so a comment. Wdyt ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, good idea! I'm going to implement that, thanks @calixteman! :)
CLOCCLOCexplanation to the READMEThanks in advance for your review! :)