Logical lines of code counter

Sylvain Thenault sylvain.thenault at nospam.logilab.fr
Tue Aug 24 04:34:16 EDT 2004


On Sun, 22 Aug 2004 23:43:25 -0400, Leif K-Brooks wrote:

> Tim Leslie wrote:
>> On Sun, 22 Aug 2004 21:44:17 -0400, Leif K-Brooks
>> <eurleif at ecritters.biz> wrote:
>> 
>>>I got bored with working on larger projects and wrote a little
>>>script/module for counting logical (not physical) lines of Python code
>>>in a file or directory.
>> If you want something which can do this and so much more, have a look at
>> pylint.
>> 
>> http://www.logilab.org/projects/pylint
> 
> Neat-looking tool, but not really usable for me. It counts physical lines,
> not logical lines; it doesn't seem to have an option to recursively scan
> all sub-directories and files in a directory; and it refuses to process a
> file if some of the modules code wants to import aren't importable, which
> is the case with mod_python code.

pylint counts both physical lines and logical lines, but all collected
values are not displayed in reports. You should easily add a new report to
display some additional information if you need it. Well, it lacks some
documentation but the code is quite clean and I would be happy to help.

It's also possible to recursivly scan for all python modules in a
given package ("pylint mypackage"). The problem with failing import is the
most annoying one. I plan to fix it, one day ;)

-- 
Sylvain Thénault                               LOGILAB, Paris (France).

http://www.logilab.com   http://www.logilab.fr  http://www.logilab.org





More information about the Python-list mailing list