Bug 36759 - check-webkit-style: Eliminate explicit slash characters from _rel_path()
Summary: check-webkit-style: Eliminate explicit slash characters from _rel_path()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Chris Jerdonek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-29 09:14 PDT by Chris Jerdonek
Modified: 2010-03-29 16:18 PDT (History)
6 users (show)

See Also:


Attachments
Proposed patch (2.50 KB, patch)
2010-03-29 09:23 PDT, Chris Jerdonek
no flags Details | Formatted Diff | Diff

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