Extend twistedchecker to run on arbitrary directories

Bug #1152780 reported by Richard Wall
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
twistedchecker
New
Undecided
Unassigned

Bug Description

Twistedchecker currently expects a python module or package directory
as an argument.

It would useful if you could also pass it an arbitrary directory which
it would search recursively for any python files.

This would be more consistent with the behaviour of Pyflakes.
 * https://bazaar.launchpad.net/~pyflakes-dev/pyflakes/master/view/head:/pyflakes/api.py#L89

{{{
#!python
def iterSourceCode(paths):
    """
    Iterate over all Python source files in C{paths}.

    @param paths: A list of paths. Directories will be recursed into and
        any .py files found will be yielded. Any non-directories will be
        yielded as-is.
    """
    for path in paths:
        if os.path.isdir(path):
            for dirpath, dirnames, filenames in os.walk(path):
                for filename in filenames:
                    if filename.endswith('.py'):
                        yield os.path.join(dirpath, filename)
        else:
            yield path
}}}

This idea was raised by Tom in the comments in:
 * http://tm.tl/84

Which discusses the Twisted Better Examples plan:
 * https://twistedmatrix.com/trac/wiki/Plan/BetterExamples#Pyflakesbuildershouldcheckexamplecode

It is a blocker for:
 * https://bugs.launchpad.net/twisted-buildbot-configuration/+bug/1152535

Richard Wall (richardw)
summary: - Extend twistedchcker to run on arbitrary directories
+ Extend twistedchecker to run on arbitrary directories
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.