Bug 36759

Summary: check-webkit-style: Eliminate explicit slash characters from _rel_path()
Product: WebKit Reporter: Chris Jerdonek <cjerdonek>
Component: Tools / TestsAssignee: Chris Jerdonek <cjerdonek>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, cjerdonek, commit-queue, eric, hamaji, levin
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Proposed patch none

Description Chris Jerdonek 2010-03-29 09:14:42 PDT
Eliminate explicit slash characters from _rel_path(), as discussed here:

https://bugs.webkit.org/show_bug.cgi?id=35498#c27

This will make the implementation more platform-independent.
Comment 1 Chris Jerdonek 2010-03-29 09:23:10 PDT
Created attachment 51922 [details]
Proposed patch
Comment 2 Shinichiro Hamaji 2010-03-29 09:43:28 PDT
Comment on attachment 51922 [details]
Proposed patch

> -    if rel_path and rel_path[0] not in slash_chars:
> -        # Then we are in the case typified by the following example:
> +    if not rel_path:
> +        # Then the paths are the same.
> +        pass

Ah, this patch let me notice we cannot run check-webkit-style with the root checkout directory

% ./WebKitTools/Scripts/check-webkit-style `pwd`  # in WebKit checkout directory
File not a recognized type to check. Skipping: ""
Total errors found: 0 in 1 files

and

% ./WebKitTools/Scripts/check-webkit-style .  # in WebKit checkout directory
File not a recognized type to check. Skipping: ""
Total errors found: 0 in 1 files

But this would be another issue. Let's go ahead as is.
Comment 3 Chris Jerdonek 2010-03-29 11:05:30 PDT
(In reply to comment #2)
> (From update of attachment 51922 [details])
> > -    if rel_path and rel_path[0] not in slash_chars:
> > -        # Then we are in the case typified by the following example:
> > +    if not rel_path:
> > +        # Then the paths are the same.
> > +        pass
> 
> Ah, this patch let me notice we cannot run check-webkit-style with the root
> checkout directory

Yes, I was wondering about that.  It looks like it might suffice to return os.curdir in that case.  But yes, we can do that later.
Comment 4 WebKit Commit Bot 2010-03-29 16:18:34 PDT
Comment on attachment 51922 [details]
Proposed patch

Clearing flags on attachment: 51922

Committed r56747: <http://trac.webkit.org/changeset/56747>
Comment 5 WebKit Commit Bot 2010-03-29 16:18:39 PDT
All reviewed patches have been landed.  Closing bug.