Skip Menu |
 

This queue is for tickets about the Perl-Tidy CPAN distribution.

Report information
The Basics
Id: 124354
Status: resolved
Priority: 0/
Queue: Perl-Tidy

People
Owner: Nobody in particular
Requestors: HOLCAPEK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 20180101
Fixed in: (no value)



Subject: --indent-only inserts lots of newlines
Download (untitled) / with headers
text/plain 724b
.perltidyrc: <cut> --nostandard-output --backup-and-modify-in-place --backup-file-extension=/ --indent-only </cut> source (number lines on the left): <cut> 1 package Foo; 2 3 use Moose; 4 5 has a => ( is => 'ro', isa => 'Int' ); 6 has b => ( is => 'ro', isa => 'Int' ); 7 has c => ( is => 'ro', isa => 'Int' ); 8 9 __PACKAGE__->meta->make_immutable; </cut> tidied source: <cut> 1 package Foo; 2 3 4 use Moose; 5 6 7 has a => ( is => 'ro', isa => 'Int' ); 8 9 has b => ( is => 'ro', isa => 'Int' ); 10 11 has c => ( is => 'ro', isa => 'Int' ); 12 13 14 __PACKAGE__->meta->make_immutable; 15 </cut>
Subject: Re: [rt.cpan.org #124354] --indent-only inserts lots of newlines
Date: Wed, 7 Feb 2018 05:39:48 -0800
To: bug-Perl-Tidy [...] rt.cpan.org
From: Steven Hancock <s7078hancock [...] gmail.com>
Download (untitled) / with headers
text/plain 1.6k
Jan, Thanks! I discovered that myself just last night too. Each line is getting two newlines. A patch is attached. It is a one-line update. I will release a new version in about two weeks. The bug, in which the results of a function called 'trim' were not being used, was actually always in the program. Previously, however, there was nothing to trim, so the bug was benign. Steve On Wed, Feb 7, 2018 at 5:17 AM, Jan Holčapek via RT < bug-Perl-Tidy@rt.cpan.org> wrote: Show quoted text
> Wed Feb 07 08:17:46 2018: Request 124354 was acted upon. > Transaction: Ticket created by HOLCAPEK > Queue: Perl-Tidy > Subject: --indent-only inserts lots of newlines > Broken in: 20180101 > Severity: Important > Owner: Nobody > Requestors: HOLCAPEK@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=124354 > > > > .perltidyrc: > <cut> > --nostandard-output > --backup-and-modify-in-place > --backup-file-extension=/ > --indent-only > </cut> > > source (number lines on the left): > <cut> > 1 package Foo; > 2 > 3 use Moose; > 4 > 5 has a => ( is => 'ro', isa => 'Int' ); > 6 has b => ( is => 'ro', isa => 'Int' ); > 7 has c => ( is => 'ro', isa => 'Int' ); > 8 > 9 __PACKAGE__->meta->make_immutable; > </cut> > > tidied source: > <cut> > 1 package Foo; > 2 > 3 > 4 use Moose; > 5 > 6 > 7 has a => ( is => 'ro', isa => 'Int' ); > 8 > 9 has b => ( is => 'ro', isa => 'Int' ); > 10 > 11 has c => ( is => 'ro', isa => 'Int' ); > 12 > 13 > 14 __PACKAGE__->meta->make_immutable; > 15 > </cut> >
Download patch.txt
text/plain 359b

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #124354] --indent-only inserts lots of newlines
Date: Wed, 7 Feb 2018 05:47:29 -0800
To: bug-Perl-Tidy [...] rt.cpan.org
From: Steven Hancock <s7078hancock [...] gmail.com>
Download (untitled) / with headers
text/plain 2.3k
I don't think that patch came through as an attachment, so here it is: --- Tidy.pm 2017-12-31 06:52:58.000000000 -0800 +++ Tidy.pm.fixed 2018-02-07 05:30:14.032526322 -0800 @@ -10251,7 +10251,7 @@ { $line = join "", @{$rtokens}[ 0 .. $jmax - 1 ]; } - trim($line); + $line = trim($line); extract_token(0); $token = $line; On Wed, Feb 7, 2018 at 5:40 AM, Steven Hancock via RT < bug-Perl-Tidy@rt.cpan.org> wrote: Show quoted text
> Queue: Perl-Tidy > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=124354 > > > Jan, > Thanks! I discovered that myself just last night too. Each line is getting > two newlines. A patch is attached. It is a one-line update. I will release > a new version in about two weeks. > > The bug, in which the results of a function called 'trim' were not being > used, was actually always in the program. Previously, however, there was > nothing to trim, so the bug was benign. > Steve > > On Wed, Feb 7, 2018 at 5:17 AM, Jan Holčapek via RT < > bug-Perl-Tidy@rt.cpan.org> wrote: >
> > Wed Feb 07 08:17:46 2018: Request 124354 was acted upon. > > Transaction: Ticket created by HOLCAPEK > > Queue: Perl-Tidy > > Subject: --indent-only inserts lots of newlines > > Broken in: 20180101 > > Severity: Important > > Owner: Nobody > > Requestors: HOLCAPEK@cpan.org > > Status: new > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=124354 > > > > > > > .perltidyrc: > > <cut> > > --nostandard-output > > --backup-and-modify-in-place > > --backup-file-extension=/ > > --indent-only > > </cut> > > > > source (number lines on the left): > > <cut> > > 1 package Foo; > > 2 > > 3 use Moose; > > 4 > > 5 has a => ( is => 'ro', isa => 'Int' ); > > 6 has b => ( is => 'ro', isa => 'Int' ); > > 7 has c => ( is => 'ro', isa => 'Int' ); > > 8 > > 9 __PACKAGE__->meta->make_immutable; > > </cut> > > > > tidied source: > > <cut> > > 1 package Foo; > > 2 > > 3 > > 4 use Moose; > > 5 > > 6 > > 7 has a => ( is => 'ro', isa => 'Int' ); > > 8 > > 9 has b => ( is => 'ro', isa => 'Int' ); > > 10 > > 11 has c => ( is => 'ro', isa => 'Int' ); > > 12 > > 13 > > 14 __PACKAGE__->meta->make_immutable; > > 15 > > </cut> > >
> >
This is fixed in version 20180219
On Sun Feb 18 14:42:54 2018, SHANCOCK wrote: Show quoted text
> This is fixed in version 20180219
Thanks!


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.