Bug 57008 - prepare-ChangeLog doesn't find names of modified classes/methods in Python source files
Summary: prepare-ChangeLog doesn't find names of modified classes/methods in Python so...
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: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-24 05:59 PDT by Adam Roben (:aroben)
Modified: 2011-11-22 08:53 PST (History)
3 users (show)

See Also:


Attachments
Teach prepare-ChangeLog how to find changed classes/methods/functions in Python files (4.51 KB, patch)
2011-11-22 07:34 PST, Adam Roben (:aroben)
no flags Details | Formatted Diff | Diff
Teach prepare-ChangeLog how to find changed classes/methods/functions in Python files (4.74 KB, patch)
2011-11-22 07:36 PST, Adam Roben (:aroben)
dbates: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Roben (:aroben) 2011-03-24 05:59:03 PDT
prepare-ChangeLog doesn't find names of modified classes/methods in Python source files. It would be nice if it did this, as it would encourage writing more detailed ChangeLogs.
Comment 1 Adam Roben (:aroben) 2011-11-22 07:34:04 PST
Created attachment 116226 [details]
Teach prepare-ChangeLog how to find changed classes/methods/functions in Python files
Comment 2 Adam Roben (:aroben) 2011-11-22 07:36:45 PST
Created attachment 116227 [details]
Teach prepare-ChangeLog how to find changed classes/methods/functions in Python files
Comment 3 Adam Roben (:aroben) 2011-11-22 07:57:53 PST
I tried to write unit tests for this following the model of the run-leaks tests. But trying to load prepare-ChangeLog as a module doesn't seem to work due to the global variables it uses.
Comment 4 Daniel Bates 2011-11-22 08:36:10 PST
Comment on attachment 116227 [details]
Teach prepare-ChangeLog how to find changed classes/methods/functions in Python files

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

This looks good to me. I have some minor nits.

> Tools/ChangeLog:12
> +        or that use python as their interpreter. Modified the code that extracts the interpreter to

Nit: python => Python

> Tools/ChangeLog:13
> +        ignore an leading "/usr/bin/env " in the interpreter line, as is common for our Python

Nit: an => a

> Tools/Scripts/prepare-ChangeLog:1274
> +            for (; $i < scalar(@scopeStack); ++$i) {

Nit: scalar(@scopeStack) => @scopeStack

It's unnecessary to call scalar() in this context.

> Tools/Scripts/prepare-ChangeLog:1282
> +            for ($i = 0; $i < scalar(@poppedScopes); ++$i) {

Nit: scalar(@poppedScopes) => @poppedScopes

> Tools/Scripts/prepare-ChangeLog:1283
> +                my $lineAfterEnd = $i + 1 == scalar(@poppedScopes) ? $. : $poppedScopes[$i + 1]->{line};

Ditto.

> Tools/Scripts/prepare-ChangeLog:1286
> +            scalar(@scopeStack) or warn "Popped off last scope at $fileName:$.\n";

Ditto.
Comment 5 Adam Roben (:aroben) 2011-11-22 08:44:45 PST
Comment on attachment 116227 [details]
Teach prepare-ChangeLog how to find changed classes/methods/functions in Python files

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

>> Tools/ChangeLog:12
>> +        or that use python as their interpreter. Modified the code that extracts the interpreter to
> 
> Nit: python => Python

Here I was referring to "python" the utility, not Python the language.

>> Tools/ChangeLog:13
>> +        ignore an leading "/usr/bin/env " in the interpreter line, as is common for our Python
> 
> Nit: an => a

Fixed.

>> Tools/Scripts/prepare-ChangeLog:1274
>> +            for (; $i < scalar(@scopeStack); ++$i) {
> 
> Nit: scalar(@scopeStack) => @scopeStack
> 
> It's unnecessary to call scalar() in this context.

Removed.

>> Tools/Scripts/prepare-ChangeLog:1282
>> +            for ($i = 0; $i < scalar(@poppedScopes); ++$i) {
> 
> Nit: scalar(@poppedScopes) => @poppedScopes

Removed.

>> Tools/Scripts/prepare-ChangeLog:1283
>> +                my $lineAfterEnd = $i + 1 == scalar(@poppedScopes) ? $. : $poppedScopes[$i + 1]->{line};
> 
> Ditto.

Removed.

>> Tools/Scripts/prepare-ChangeLog:1286
>> +            scalar(@scopeStack) or warn "Popped off last scope at $fileName:$.\n";
> 
> Ditto.

Removed.
Comment 6 Adam Roben (:aroben) 2011-11-22 08:53:01 PST
Committed r101005: <http://trac.webkit.org/changeset/101005>