⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 268752 in webkit


Ignore:
Timestamp:
Oct 20, 2020, 12:13:22 PM (6 years ago)
Author:
aakash_jain@apple.com
Message:

Make report-non-inclusive-language ignore autoinstalled directories and certain file types
https://bugs.webkit.org/show_bug.cgi?id=217972

Reviewed by Beth Dakin.

  • Scripts/report-non-inclusive-language: startswith and endswith also takes a tuple of suffixes to

look for, reference: https://docs.python.org/3/library/stdtypes.html#str.endswith

Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r268749 r268752  
     12020-10-20  Aakash Jain  <aakash_jain@apple.com>
     2
     3        Make report-non-inclusive-language ignore autoinstalled directories and certain file types
     4        https://bugs.webkit.org/show_bug.cgi?id=217972
     5
     6        Reviewed by Beth Dakin.
     7
     8        * Scripts/report-non-inclusive-language: startswith and endswith also takes a tuple of suffixes to
     9        look for, reference: https://docs.python.org/3/library/stdtypes.html#str.endswith
     10
    1112020-10-20  Aakash Jain  <aakash_jain@apple.com>
    212
  • trunk/Tools/Scripts/report-non-inclusive-language

    r265304 r268752  
    3434#   Report third party sources separately from WebKit project files.
    3535#   Skip known examples on an exception list that we don't intend to fix.
    36 #   Replace special cases for ChangeLog, ".order", ".xcuserstate", ".git", ".svn"
    37 #   files with something smarter.
    3836
    3937# Hard-coded for now, could read these out of a file instead.
     
    4442    [ "slave", "slave" ]
    4543]
     44
     45IGNORE_DIRECTORIES = ['.svn', '.git', 'autoinstalled']
     46IGNORE_FILES_STARTING_WITH = ('ChangeLog')
     47IGNORE_FILES_ENDING_WITH = ('.log', '.order', '.pyc', '.swp', '.xcuserstate')
    4648
    4749parser = argparse.ArgumentParser(description='Report counts and locations of non-inclusive terms.')
     
    5759for subroot, directories, files in os.walk(root):
    5860    prefix = subroot[len(root) + 1:]
    59     if ".svn" in prefix:
    60         continue
    61     if ".git" in prefix:
     61    if any(directory in prefix for directory in IGNORE_DIRECTORIES):
    6262        continue
    6363    for file in files:
    64         if file.startswith("ChangeLog"):
     64        if file.startswith(IGNORE_FILES_STARTING_WITH):
    6565            continue
    66         if file.endswith(".order"):
    67             continue
    68         if file.endswith(".xcuserstate"):
     66        if file.endswith(IGNORE_FILES_ENDING_WITH):
    6967            continue
    7068        handle = open(os.path.join(subroot, file), "r")
Note: See TracChangeset for help on using the changeset viewer.