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: 65231
Status: open
Priority: 0/
Queue: Perl-Critic

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

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



Subject: RequireTrailingCommas only at newline
Date: Sat, 29 Jan 2011 12:01:36 +1100
To: bug-Perl-Critic [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
I find the way RequireTrailingCommas asks for my @list = ($foo, $bar, $baz,); a bit too strict. I think I prefer, in general, no comma if the closing paren is on the same line, like my @list = ($foo, $bar, $baz); though still demand the comma if a newline like my @list = ($foo, $bar, $baz, ); What chance an option "only_at_newline" or some such name, which relaxed to allow that "$baz);" one? I was contemplating a separate policy called maybe something like RequireTrailingCommasAtNewline which was the flavour I think I want, but an option might be better.
On Fri Jan 28 20:01:46 2011, user42@zip.com.au wrote: Show quoted text
> I find the way RequireTrailingCommas asks for > > my @list = ($foo, > $bar, > $baz,); > > a bit too strict. I think I prefer, in general, no comma if the closing > paren is on the same line, like > > my @list = ($foo, > $bar, > $baz); > > though still demand the comma if a newline like > > my @list = ($foo, > $bar, > $baz, > ); > > What chance an option "only_at_newline" or some such name, which relaxed > to allow that "$baz);" one?
Given the number of "Wishlist" items in the queue, I hesitate to answer. But the policy itself is fairly simple, and maybe an option would not make it too complicated. Given that this is a PBP policy, though, I think the default would have to be the current behavior. Tom
Subject: Re: [rt.cpan.org #65231] RequireTrailingCommas only at newline
Date: Wed, 02 Feb 2011 10:50:56 +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
> > complicated
A further variation I've contemplated is allowing no trailing comma in a function call, foo ( 1, # arg one 2 # arg one ); Some people seem to like to spread out calls, and it makes some sense not to put a trailing comma if foo only ever takes two args. (Not something you can easily tell from the text as such, of course.) Personally I'm not too worried about that, only if it was worth thinking about distinguishing lists from funcs in possible options.
Subject: Re: [rt.cpan.org #65231] RequireTrailingCommas only at newline
Date: Sun, 22 May 2011 11:30:09 +1000
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
> > maybe an option would not make it too complicated.
Does that mean if I write an option you will apply it? Or I should make my own policy?