Bug 225789

Summary: report-non-inclusive-language should skip symlinks
Product: WebKit Reporter: Aakash Jain <aakash_jain>
Component: Tools / TestsAssignee: Aakash Jain <aakash_jain>
Status: RESOLVED FIXED    
Severity: Normal CC: aakash_jain, ap, bdakin, darin, ryanhaddad, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 213092    
Attachments:
Description Flags
Patch none

Description Aakash Jain 2021-05-13 16:48:15 PDT
report-non-inclusive-language should skip symlinks. Currently the script fails with an error if there is a symlink pointing to a non-existing file. 

Traceback (most recent call last):
  File "OpenSource/Tools/Scripts/report-non-inclusive-language", line 70, in <module>
    handle = open(os.path.join(subroot, file), "r")
IOError: [Errno 2] No such file or directory: 'testdir/symlink-pointing-to-non-existing-file'
Comment 1 Aakash Jain 2021-05-13 16:56:23 PDT
Also most likely the linked file would be checked directly by the script while iterating the directory structure and would result in it being counted twice.
Comment 2 Aakash Jain 2021-05-13 16:57:56 PDT
Created attachment 428578 [details]
Patch
Comment 3 Darin Adler 2021-05-13 18:27:07 PDT
Comment on attachment 428578 [details]
Patch

How did you discover the need for this? Who’s using this on directories with symlinks in them?
Comment 4 Aakash Jain 2021-05-13 18:31:33 PDT
> How did you discover the need for this? 
I discovered this while running this script on an "Internal" repository.
Comment 5 Radar WebKit Bug Importer 2021-05-13 18:34:54 PDT
<rdar://problem/77998004>
Comment 6 EWS 2021-05-13 19:06:14 PDT
Committed r277476 (237711@main): <https://commits.webkit.org/237711@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 428578 [details].