Your message dated Fri, 30 Sep 2022 20:18:00 +0200
with message-id <87zgegk9pj....@hands.com>
and subject line fixed since 20220613-1 (or probably before that)
has caused the Debian Bug report #564260,
regarding perltidy (-pbp) desalign hashes in given-when construct
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)
--
564260: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=564260
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: perltidy
Version: 20090616-1
Severity: minor
Hi Don
I have a small sample.pl showing the problem, running perltidy on it,
causes the hash to 'de-align':
---(sample.pl)--------------------------------------------------------
#!/usr/bin/perl
use 5.010;
use feature "switch";
my $self;
open( FH, '<', '/tmp/foo.txt' ) or die "Cannot open file: $!\n";
while ( my $line = <FH> ) {
given ($line) {
when (/^#/) {
$self = {
what => 'comment',
help => 'help',
};
}
when (/^foo/) {
$self = {
what => 'foo',
help => 'bar',
};
}
}
}
----------------------------------------------------------------------
Now running 'perltidy -pbp' on sample.pl, causes following output:
---(output)-----------------------------------------------------------
#!/usr/bin/perl
use 5.010;
use feature "switch";
my $self;
open( FH, '<', '/tmp/foo.txt' ) or die "Cannot open file: $!\n";
while ( my $line = <FH> ) {
given ($line) {
when (/^#/) {
$self = {
what => 'comment',
help => 'help',
};
}
when (/^foo/) {
$self = {
what => 'foo',
help => 'bar',
};
}
}
}
----------------------------------------------------------------------
The diff now shows the problem (I evne had an example where a
semicolon was added, but I need to find first a smaller example to
reproduce that.
---(diff)-------------------------------------------------------------
--- sample.pl 2010-01-08 20:26:50.000000000 +0100
+++ sample.perltidyfied 2010-01-08 20:27:22.000000000 +0100
@@ -10,14 +10,14 @@
given ($line) {
when (/^#/) {
$self = {
- what => 'comment',
- help => 'help',
+ what => 'comment',
+ help => 'help',
};
}
when (/^foo/) {
$self = {
- what => 'foo',
- help => 'bar',
+ what => 'foo',
+ help => 'bar',
};
}
}
----------------------------------------------------------------------
Many thanks in case for looking into it,
Bests
Salvatore
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.26-2-amd64 (SMP w/8 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Versions of packages perltidy depends on:
ii perl 5.10.1-8 Larry Wall's Practical Extraction
perltidy recommends no packages.
perltidy suggests no packages.
-- no debconf information
#!/usr/bin/perl
use 5.010;
use feature "switch";
my $self;
open( FH, '<', '/tmp/foo.txt' ) or die "Cannot open file: $!\n";
while ( my $line = <FH> ) {
given ($line) {
when (/^#/) {
$self = {
what => 'comment',
help => 'help',
};
}
when (/^foo/) {
$self = {
what => 'foo',
help => 'bar',
};
}
}
}
--- End Message ---
--- Begin Message ---
fixed - 20220613-1
done
In recent versions, this seems to work fine:
$ cat tidytest.pl
#!/usr/bin/perl
use 5.010;
use feature "switch";
my $self;
open( FH, '<', '/tmp/foo.txt' ) or die "Cannot open file: $!\n";
while ( my $line = <FH> ) {
given ($line) {
when (/^#/) {
$self = {
what => 'comment',
help => 'help',
};
}
when (/^foo/) {
$self = {
what => 'foo',
help => 'bar',
};
}
}
}
$ perltidy -st tidytest.pl
#!/usr/bin/perl
use 5.010;
use feature "switch";
my $self;
open( FH, '<', '/tmp/foo.txt' ) or die "Cannot open file: $!\n";
while ( my $line = <FH> ) {
given ($line) {
when (/^#/) {
$self = {
what => 'comment',
help => 'help',
};
}
when (/^foo/) {
$self = {
what => 'foo',
help => 'bar',
};
}
}
}
$
--- End Message ---