Re: rename_rev.pl script for reviewing renames

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 03, 2011 at 01:08:28PM +0300, Dan Carpenter wrote:
> There are a lot of refactoring patches where people change camel case
> names to kernel style names etc.  I've written a script to make it
> easier to review them.  It's attached.

Cool, thanks for sharing. I guess my comments won't matter much, here
they are anyway :)

> sub usage() {
>     print "cat diff | transform.pl old new old new old new...\n";

Filename of the tool does not match.

>     # white space at the end of lines
>     $line =~ s/ *$//g;
>     $line =~ s/\t*$//g;

Character class here as well? Will also get mixtures of the two.

> while (<>) {
>     my $line = $_;

You could work here with plain $_, but I assume you don't do on purpose.

> 
>     if ($line =~ /^---/) {
> 	next;
>     }
>     if ($line =~ /^\+\+\+/) {
> 	next;
>     }

Use an alternation in the regexp?

>     my $output = filter($line);
>     if ($line =~ /^-/) {
> 	print $oldfh $output;
> 	next;
>     }
>     if ($line =~ /^\+/) {
> 	print $newfh $output;
> 	next;
>     }

Ditto.

Regards,

   Wolfram

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

Attachment: signature.asc
Description: Digital signature

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux