Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 65230
Status: open
Priority: 0/
Queue: Perl-Critic

People
Owner: Nobody in particular
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

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



Subject: ProhibitTrailingWhitespace comments, strings, heredocs
Date: Sat, 29 Jan 2011 11:53:45 +1100
To: bug-Perl-Critic [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
ProhibitTrailingWhitespace doesn't seem to detect whitespace at the end of comment lines, in strings, or in here documents. Is that intentional? It'd be good if it looked at pretty much everything, even text after __END__, since as its docs say stuff not readily visible can make life hard.
On Fri Jan 28 19:53:39 2011, user42@zip.com.au wrote: Show quoted text
> ProhibitTrailingWhitespace doesn't seem to detect whitespace at the end > of comment lines, in strings, or in here documents. Is that > intentional? > > It'd be good if it looked at pretty much everything, even text after > __END__, since as its docs say stuff not readily visible can make life > hard.
Thank you for the report. Given the description of the policy, it's hard to argue with your points, though in the case of strings I take your point to be about strings with embedded literal newlines, rather than strings in general. That is, I can see checking my $slogan = "We have met the enemy and he is us"; but I am loath to have the policy complain about my $greeting = "Hello sailor "; The same principal seems (to me at least) to apply to the stuff after __END__. But maybe some of the other developers have a different take on this? Tom
Subject: Re: [rt.cpan.org #65230] ProhibitTrailingWhitespace comments, strings, heredocs
Date: Wed, 02 Feb 2011 09:56:19 +1100
To: bug-Perl-Critic [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
"Tom Wyant via RT" <bug-Perl-Critic@rt.cpan.org> writes: Show quoted text
> > my $slogan = "We have met the enemy > and he is us";
I've got no worries about newlines in strings (pretty useful), only spaces before newlines in strings, my $str = "abc<space><space> def"; where <space> is a space, the same as is currently detected by the policy in plain code. Trailing whitespace in strings may be worse than for code in fact. In code there's no ill effect, but a string with spaces risks looking right but being wrong, or being right but becoming wrong if someone foolish does a delete-trailing-whitespace, etc. Show quoted text
> my $greeting = "Hello sailor ";
Yes, no worries about that, I don't think that's the intention of the policy.