Subject: | Unexpected behavior of --indent-only option together with --delete-all-comments |
Date: | Thu, 28 Jan 2016 20:59:48 +0300 |
To: | bug-perl-tidy [...] rt.cpan.org |
From: | Dmitry Veltishev <vdm-photo [...] ya.ru> |
Hello all,
I've noticed that current version of perltidy does not remove all comments from script if --indent-only options is specified.
Seems that it wipes off only lines that does not contain any code.
Consider following file sample.pl:
----------------
use strict;
use warnings;
my $x = 1; # comment not removed
# comment will be removed
my $y = 2; # comment also not removed
my $x = 1; # comment not removed
# comment will be removed
my $y = 2; # comment also not removed
----------------
running following command
perltidy --indent-only --delete-all-comments sample.pl -st
produces following output:
----------------
use strict;
use warnings;
my $x = 1; # comment not removed
my $y = 2; # comment also not removed
my $x = 1; # comment not removed
my $y = 2; # comment also not removed
----------------
excluding --indent-only from command line arguments leads to removal of really ALL comments.
manpage section describing --indent-only does not say anything on this case.
As for me, this behavior is unexpected - all comments should be removed with -dac, not only "pure" comment lines.
--
Regards, Dmitry Veltishev
mailto: vdm-photo@ya.ru
Regards, Dmitry Veltishev
mailto: vdm-photo@ya.ru