[Webkit-unassigned] [Bug 35234] [check-webkit-style] Make it possible to scan directories

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 23 13:59:04 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=35234





--- Comment #4 from Chris Jerdonek <cjerdonek at webkit.org>  2010-02-23 13:59:04 PST ---
(In reply to comment #1)
> Created an attachment (id=49203)
 --> (https://bugs.webkit.org/attachment.cgi?id=49203) [details]
> Add the ability to check directories in addition to a list of files

You may want to consider a simpler, non-recursive approach using os.walk.

For example, I came across the following method in pep8.py (which we will be
using) which seems to do the same thing:

def input_dir(dirname):
    """
    Check all Python source files in this directory and all subdirectories.
    """
    dirname = dirname.rstrip('/')
    if excluded(dirname):
        return
    for root, dirs, files in os.walk(dirname):
        if options.verbose:
            message('directory ' + root)
        options.counters['directories'] = \
            options.counters.get('directories', 0) + 1
        dirs.sort()
        for subdir in dirs:
            if excluded(subdir):
                dirs.remove(subdir)
        files.sort()
        for filename in files:
            if filename_match(filename):
                input_file(os.path.join(root, filename))

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list