Bug 225789 - report-non-inclusive-language should skip symlinks
Summary: report-non-inclusive-language should skip symlinks
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Aakash Jain
URL:
Keywords: InRadar
Depends on:
Blocks: 213092
  Show dependency treegraph
 
Reported: 2021-05-13 16:48 PDT by Aakash Jain
Modified: 2021-05-17 10:01 PDT (History)
6 users (show)

See Also:


Attachments
Patch (1.39 KB, patch)
2021-05-13 16:57 PDT, Aakash Jain
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].