Skip Menu |

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

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

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

Bug Information
Severity: Normal
Broken in: 20140328
Fixed in: (no value)



Subject: -io keeping line width formatting for comments
Hello, The documentation for -io states: "This flag is used to deactivate all formatting and line break changes within non-blank lines of code." To me this says that all formatting will be ignored including length of line. That statement is true for code lines but currently not for comments. We've found that a tidy such as: perltidy -io --freeze-blank-lines -i=4 -b -bext='/' sample.pm On a file with: sub foo { # long comment ################################################################$ bar(); } sub bar { # short comment foo(); } Will produce: sub foo { # long comment ################################################################################################################## bar(); } sub bar { # short comment foo(); } As opposed to: sub foo { # long comment ################################################################################################################## bar(); } sub bar { # short comment foo(); } With long comment lines being moved to the left rather than being indented where they should be. Long code lines are formatted as expected with the correct indentation. Let me know if you have any questions. Lyle
Subject: Re: [rt.cpan.org #95709] -io keeping line width formatting for comments
Date: Thu, 29 May 2014 15:24:21 -0700
To: "bug-Perl-Tidy [...] rt.cpan.org" <bug-Perl-Tidy [...] rt.cpan.org>
From: Steven Hancock <s7078hancock [...] gmail.com>
Hi, Sorry for the delay in responding, I've been traveling. This is a documentation issue rather than a bug, and I'll clarify the documentation in the next release. You can use "-l=0" to keep comments from moving. Steve On Fri, May 16, 2014 at 8:04 AM, Lyle Hopkins via RT < bug-Perl-Tidy@rt.cpan.org> wrote: Show quoted text
> Fri May 16 11:04:57 2014: Request 95709 was acted upon. > Transaction: Ticket created by COSMICNET > Queue: Perl-Tidy > Subject: -io keeping line width formatting for comments > Broken in: 20140328 > Severity: Normal > Owner: Nobody > Requestors: COSMICNET@cpan.org > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=95709 > > > > Hello, > The documentation for -io states: > "This flag is used to deactivate all formatting and line break changes > within non-blank lines of code." > > To me this says that all formatting will be ignored including length of > line. That statement is true for code lines but currently not for comments. > We've found that a tidy such as: > perltidy -io --freeze-blank-lines -i=4 -b -bext='/' sample.pm > > On a file with: > sub foo { > # long comment > ################################################################$ > bar(); > } > > sub bar { > # short comment > foo(); > } > > Will produce: > sub foo { > # long comment > ################################################################################################################## > bar(); > } > > sub bar { > # short comment > foo(); > } > > As opposed to: > sub foo { > # long comment > ################################################################################################################## > bar(); > } > > sub bar { > # short comment > foo(); > } > > With long comment lines being moved to the left rather than being indented > where they should be. > > Long code lines are formatted as expected with the correct indentation. > > Let me know if you have any questions. > > > Lyle >
Perltidy documentation updated to clarify this in version 20140711, thanks for the report.