[Webkit-unassigned] [Bug 215156] Make report-non-inclusive-language ignore files within .svn and .git

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 5 11:39:38 PDT 2020


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

--- Comment #2 from Darin Adler <darin at apple.com> ---
Comment on attachment 405985
  --> https://bugs.webkit.org/attachment.cgi?id=405985
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=405985&action=review

> Tools/Scripts/report-non-inclusive-language:69
> +        if prefix.find(".svn") >= 0:
> +            continue
> +        if prefix.find(".git") >= 0:
> +            continue

1. I suggest doing before the "for file in files:" loop, since it’s a check on the entire directory, not individual files.

2. I found documentation here <https://docs.python.org/2/library/stdtypes.html#string-methods> that says you can and should write this instead:

    if ".svn" in prefix:
        continue;

3. (This seems to supersede both 1 and 2 above.)

II did a little research and found a different solution, a way to make os.walk not even recurse into these directories. We can write this in the os.walk loop (outside the "for file in files" loop):

    directories = [directory for directory in directories if not directory.startswith(".svn")]

Then it will never even recurse into a that starts with .svn. Maybe there’s a nicer way to write it if you are a Python expert.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200805/89d84a12/attachment-0001.htm>


More information about the webkit-unassigned mailing list