简体   繁体   中英

How to calculate lines of code, comments and docstrings for a Python module?

Is there a tool or snippet that produces the following output in some form:

lines_of_code = 98
lines_of_comments = 24
lines_of_documentation = 11

NOTE 1 : I will then try to feed this data to Jenkins to graph.

NOTE 2 : I am aware that CLOC counts comments but I would like to separately count comments and docstrings.

查看PyLint: http//www.logilab.org/857

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM