Bug 82933 - check-webkit-style errors when removing .png files
Summary: check-webkit-style errors when removing .png files
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tony Chang
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-02 13:20 PDT by Florin Malita
Modified: 2012-04-02 16:55 PDT (History)
8 users (show)

See Also:


Attachments
Patch (2.99 KB, patch)
2012-04-02 14:47 PDT, Tony Chang
no flags Details | Formatted Diff | Diff
Patch for landing (3.10 KB, patch)
2012-04-02 15:01 PDT, Tony Chang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Florin Malita 2012-04-02 13:20:34 PDT
After http://trac.webkit.org/changeset/112270, removing .png files triggers the following:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/plat..." exit_code: 1
ERROR: File does not exist: 'LayoutTests/platform/mac/transforms/no_transform_hit_testing-expected.png'


Looks like we're force-processing non-existent (removed) png files (patchreader.py:66):

            if not line_numbers:
                match = re.search("\s*png$", path)
                if match:
                    if call_only_once:
                        self._text_file_reader.process_file(file_path=path, line_numbers=None)
Comment 1 Philip Rogers 2012-04-02 13:21:57 PDT
I'm hitting this as well, using vanilla SVN.
Comment 2 Tony Chang 2012-04-02 14:47:09 PDT
Created attachment 135195 [details]
Patch
Comment 3 Adam Barth 2012-04-02 14:55:48 PDT
Comment on attachment 135195 [details]
Patch

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

> Tools/Scripts/webkitpy/style/patchreader.py:55
> -    def check(self, patch_string):
> +    def check(self, patch_string, fs=FileSystem()):

Eric doesn't like this pattern because it creates a static FileSystem() object that's re-used each time this function is called, but maybe it's ok here since FileSystem is normally global-ish object.
Comment 4 Tony Chang 2012-04-02 15:01:47 PDT
Created attachment 135201 [details]
Patch for landing
Comment 5 Tony Chang 2012-04-02 15:02:21 PDT
View in context: https://bugs.webkit.org/attachment.cgi?id=135195&action=review

>> Tools/Scripts/webkitpy/style/patchreader.py:55
>> +    def check(self, patch_string, fs=FileSystem()):
> 
> Eric doesn't like this pattern because it creates a static FileSystem() object that's re-used each time this function is called, but maybe it's ok here since FileSystem is normally global-ish object.

Yeah, I thought it was OK in this case because FileSystem has no state.  I guess that might not be true in the future so I'll change it to None.
Comment 6 Tony Chang 2012-04-02 16:55:08 PDT
Committed r112963: <http://trac.webkit.org/changeset/112963>