Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: trichmond [...] proofpoint.com
Cc:
AdminCc:

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



Subject: Returning ternary operators doesn't break correctly with -baao
Date: Tue, 13 Nov 2018 01:43:22 +0000
To: "bug-Perl-Tidy [...] rt.cpan.org" <bug-Perl-Tidy [...] rt.cpan.org>
From: Todd Richmond <trichmond [...] proofpoint.com>
My coding style is to be as compact as possible and so want ternary operators to break after ? or : - the same as any other single operator to get as close to 80 columns as possible. However, perltidy seems to think returning a ternary line is a single entity and so breaks before it instead of within. Ternary lines that are not part of a return line are broken correctly. I have a much more complex perltidyrc file to try other options, but this can repro with a single -baao option perltidy -st -baao x.pm x.pm: sub x { return 0 ? 'aaaaaaaaaaaaaaaaaaaaa' : 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; } printf x(); returns sub x { return 0 ? 'aaaaaaaaaaaaaaaaaaaaa' : 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; } printf x(); but should return sub x { return 0 ? 'aaaaaaaaaaaaaaaaaaaaa' : 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; } printf x();
Subject: Re: [rt.cpan.org #127633] Returning ternary operators doesn't break correctly with -baao
Date: Tue, 13 Nov 2018 06:50:43 -0800
To: bug-Perl-Tidy [...] rt.cpan.org
From: Steven Hancock <s7078hancock [...] gmail.com>
Todd, Try adding the flag -wba='?' Steve On Mon, Nov 12, 2018 at 6:16 PM Todd Richmond via RT < bug-Perl-Tidy@rt.cpan.org> wrote: Show quoted text
> Mon Nov 12 21:16:04 2018: Request 127633 was acted upon. > Transaction: Ticket created by trichmond@proofpoint.com > Queue: Perl-Tidy > Subject: Returning ternary operators doesn't break correctly with > -baao > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: trichmond@proofpoint.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=127633 > > > > My coding style is to be as compact as possible and so want ternary > operators to break after ? or : - the same as any other single operator to > get as close to 80 columns as possible. However, perltidy seems to think > returning a ternary line is a single entity and so breaks before it instead > of within. Ternary lines that are not part of a return line are broken > correctly. I have a much more complex perltidyrc file to try other options, > but this can repro with a single -baao option > > > > > > perltidy -st -baao x.pm > > > > x.pm: > > sub x { > > return 0 ? 'aaaaaaaaaaaaaaaaaaaaa' : > 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; > > } > > printf x(); > > > > returns > > > > > > sub x { > > > > return > > > > 0 ? 'aaaaaaaaaaaaaaaaaaaaa' : > > > > 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; > > > > } > > > > printf x(); > > > > > > but should return > > > > > > sub x { > > > > return 0 ? 'aaaaaaaaaaaaaaaaaaaaa' : > > > > 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; > > > > } > > > > printf x(); > > > > > >
Subject: Re: [rt.cpan.org #127633] Returning ternary operators doesn't break correctly with -baao
Date: Tue, 13 Nov 2018 07:14:04 -0800
To: bug-Perl-Tidy [...] rt.cpan.org
From: Steven Hancock <s7078hancock [...] gmail.com>
Todd, Sorry, I misunderstood. I don't think there is a flag that can do this; I'll look into it. Steve On Tue, Nov 13, 2018 at 6:51 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=127633 > > > Todd, > Try adding the flag -wba='?' > Steve > > On Mon, Nov 12, 2018 at 6:16 PM Todd Richmond via RT < > bug-Perl-Tidy@rt.cpan.org> wrote: >
> > Mon Nov 12 21:16:04 2018: Request 127633 was acted upon. > > Transaction: Ticket created by trichmond@proofpoint.com > > Queue: Perl-Tidy > > Subject: Returning ternary operators doesn't break correctly with > > -baao > > Broken in: (no value) > > Severity: (no value) > > Owner: Nobody > > Requestors: trichmond@proofpoint.com > > Status: new > > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=127633 > > > > > > > My coding style is to be as compact as possible and so want ternary > > operators to break after ? or : - the same as any other single operator
> to
> > get as close to 80 columns as possible. However, perltidy seems to think > > returning a ternary line is a single entity and so breaks before it
> instead
> > of within. Ternary lines that are not part of a return line are broken > > correctly. I have a much more complex perltidyrc file to try other
> options,
> > but this can repro with a single -baao option > > > > > > > > > > > > perltidy -st -baao x.pm > > > > > > > > x.pm: > > > > sub x { > > > > return 0 ? 'aaaaaaaaaaaaaaaaaaaaa' : > > 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; > > > > } > > > > printf x(); > > > > > > > > returns > > > > > > > > > > > > sub x { > > > > > > > > return > > > > > > > > 0 ? 'aaaaaaaaaaaaaaaaaaaaa' : > > > > > > > > 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; > > > > > > > > } > > > > > > > > printf x(); > > > > > > > > > > > > but should return > > > > > > > > > > > > sub x { > > > > > > > > return 0 ? 'aaaaaaaaaaaaaaaaaaaaa' : > > > > > > > > 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; > > > > > > > > } > > > > > > > > printf x(); > > > > > > > > > > > >
> >
Subject: Re: [rt.cpan.org #127633] Returning ternary operators doesn't break correctly with -baao
Date: Tue, 13 Nov 2018 16:19:29 +0000
To: "bug-Perl-Tidy [...] rt.cpan.org" <bug-Perl-Tidy [...] rt.cpan.org>
From: Todd Richmond <trichmond [...] proofpoint.com>
Thx for the quick response. It probably shouldn't be a new option since a return isn't really different than an assignment - style wise. s = b ? longs1 : longs2 does format correctly On 11/13/18, 7:14 AM, "Steven Hancock via RT" <bug-Perl-Tidy@rt.cpan.org> wrote: <URL: https://urldefense.proofpoint.com/v2/url?u=https-3A__rt.cpan.org_Ticket_Display.html-3Fid-3D127633&d=DwIDaQ&c=Vxt5e0Osvvt2gflwSlsJ5DmPGcPvTRKLJyp031rXjhg&r=HPS65xby-9P9SqEqfmk6niu-T7bLhV1_QCI7Ml7zCEs&m=KlwyAZD6US6nnQFqrorkX2Wu16XUim5LO2isVgB2KjA&s=ATqt1tfdarRuGDSffM2v4eD2C2LZikM1mgdjayoOiCM&e= > Todd, Sorry, I misunderstood. I don't think there is a flag that can do this; I'll look into it. Steve On Tue, Nov 13, 2018 at 6:51 AM Steven Hancock via RT < bug-Perl-Tidy@rt.cpan.org> wrote: Show quoted text
> Queue: Perl-Tidy > Ticket <URL: https://urldefense.proofpoint.com/v2/url?u=https-3A__rt.cpan.org_Ticket_Display.html-3Fid-3D127633&d=DwIDaQ&c=Vxt5e0Osvvt2gflwSlsJ5DmPGcPvTRKLJyp031rXjhg&r=HPS65xby-9P9SqEqfmk6niu-T7bLhV1_QCI7Ml7zCEs&m=KlwyAZD6US6nnQFqrorkX2Wu16XUim5LO2isVgB2KjA&s=ATqt1tfdarRuGDSffM2v4eD2C2LZikM1mgdjayoOiCM&e= > > > Todd, > Try adding the flag -wba='?' > Steve > > On Mon, Nov 12, 2018 at 6:16 PM Todd Richmond via RT < > bug-Perl-Tidy@rt.cpan.org> wrote: >
> > Mon Nov 12 21:16:04 2018: Request 127633 was acted upon. > > Transaction: Ticket created by trichmond@proofpoint.com > > Queue: Perl-Tidy > > Subject: Returning ternary operators doesn't break correctly with > > -baao > > Broken in: (no value) > > Severity: (no value) > > Owner: Nobody > > Requestors: trichmond@proofpoint.com > > Status: new > > Ticket <URL: https://urldefense.proofpoint.com/v2/url?u=https-3A__rt.cpan.org_Ticket_Display.html-3Fid-3D127633&d=DwIDaQ&c=Vxt5e0Osvvt2gflwSlsJ5DmPGcPvTRKLJyp031rXjhg&r=HPS65xby-9P9SqEqfmk6niu-T7bLhV1_QCI7Ml7zCEs&m=KlwyAZD6US6nnQFqrorkX2Wu16XUim5LO2isVgB2KjA&s=ATqt1tfdarRuGDSffM2v4eD2C2LZikM1mgdjayoOiCM&e= > > > > > > > My coding style is to be as compact as possible and so want ternary > > operators to break after ? or : - the same as any other single operator
> to
> > get as close to 80 columns as possible. However, perltidy seems to think > > returning a ternary line is a single entity and so breaks before it
> instead
> > of within. Ternary lines that are not part of a return line are broken > > correctly. I have a much more complex perltidyrc file to try other
> options,
> > but this can repro with a single -baao option > > > > > > > > > > > > perltidy -st -baao x.pm > > > > > > > > x.pm: > > > > sub x { > > > > return 0 ? 'aaaaaaaaaaaaaaaaaaaaa' : > > 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; > > > > } > > > > printf x(); > > > > > > > > returns > > > > > > > > > > > > sub x { > > > > > > > > return > > > > > > > > 0 ? 'aaaaaaaaaaaaaaaaaaaaa' : > > > > > > > > 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; > > > > > > > > } > > > > > > > > printf x(); > > > > > > > > > > > > but should return > > > > > > > > > > > > sub x { > > > > > > > > return 0 ? 'aaaaaaaaaaaaaaaaaaaaa' : > > > > > > > > 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'; > > > > > > > > } > > > > > > > > printf x(); > > > > > > > > > > > >
> >
Subject: Re: [rt.cpan.org #127633] Returning ternary operators doesn't break correctly with -baao
Date: Tue, 13 Nov 2018 09:02:37 -0800
To: bug-Perl-Tidy [...] rt.cpan.org
From: Steven Hancock <s7078hancock [...] gmail.com>
I made a patch to fix it. I expect a release in about a week. Steve On Tue, Nov 13, 2018 at 8:55 AM Todd Richmond 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=127633 > > > Thx for the quick response. It probably shouldn't be a new option since a > return isn't really different than an assignment - style wise. s = b ? > longs1 : longs2 does format correctly > > > > On 11/13/18, 7:14 AM, "Steven Hancock via RT" <bug-Perl-Tidy@rt.cpan.org> > wrote: > > > > <URL: > https://urldefense.proofpoint.com/v2/url?u=https-3A__rt.cpan.org_Ticket_Display.html-3Fid-3D127633&d=DwIDaQ&c=Vxt5e0Osvvt2gflwSlsJ5DmPGcPvTRKLJyp031rXjhg&r=HPS65xby-9P9SqEqfmk6niu-T7bLhV1_QCI7Ml7zCEs&m=KlwyAZD6US6nnQFqrorkX2Wu16XUim5LO2isVgB2KjA&s=ATqt1tfdarRuGDSffM2v4eD2C2LZikM1mgdjayoOiCM&e=
> >
> > > > Todd, > > Sorry, I misunderstood. I don't think there is a flag that can do this; > > I'll look into it. > > Steve > > > > On Tue, Nov 13, 2018 at 6:51 AM Steven Hancock via RT < > > bug-Perl-Tidy@rt.cpan.org> wrote: > > >
> > Queue: Perl-Tidy
>
> > Ticket <URL:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__rt.cpan.org_Ticket_Display.html-3Fid-3D127633&d=DwIDaQ&c=Vxt5e0Osvvt2gflwSlsJ5DmPGcPvTRKLJyp031rXjhg&r=HPS65xby-9P9SqEqfmk6niu-T7bLhV1_QCI7Ml7zCEs&m=KlwyAZD6US6nnQFqrorkX2Wu16XUim5LO2isVgB2KjA&s=ATqt1tfdarRuGDSffM2v4eD2C2LZikM1mgdjayoOiCM&e=
> >
>
> >
>
> > Todd,
>
> > Try adding the flag -wba='?'
>
> > Steve
>
> >
>
> > On Mon, Nov 12, 2018 at 6:16 PM Todd Richmond via RT <
>
> > bug-Perl-Tidy@rt.cpan.org> wrote:
>
> >
>
> > > Mon Nov 12 21:16:04 2018: Request 127633 was acted upon.
>
> > > Transaction: Ticket created by trichmond@proofpoint.com
>
> > > Queue: Perl-Tidy
>
> > > Subject: Returning ternary operators doesn't break correctly
> with >
> > > -baao
>
> > > Broken in: (no value)
>
> > > Severity: (no value)
>
> > > Owner: Nobody
>
> > > Requestors: trichmond@proofpoint.com
>
> > > Status: new
>
> > > Ticket <URL:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__rt.cpan.org_Ticket_Display.html-3Fid-3D127633&d=DwIDaQ&c=Vxt5e0Osvvt2gflwSlsJ5DmPGcPvTRKLJyp031rXjhg&r=HPS65xby-9P9SqEqfmk6niu-T7bLhV1_QCI7Ml7zCEs&m=KlwyAZD6US6nnQFqrorkX2Wu16XUim5LO2isVgB2KjA&s=ATqt1tfdarRuGDSffM2v4eD2C2LZikM1mgdjayoOiCM&e=
> >
>
> > >
>
> > >
>
> > > My coding style is to be as compact as possible and so want ternary
>
> > > operators to break after ? or : - the same as any other single
> operator >
> > to
>
> > > get as close to 80 columns as possible. However, perltidy seems to
> think >
> > > returning a ternary line is a single entity and so breaks before it
>
> > instead
>
> > > of within. Ternary lines that are not part of a return line are
> broken >
> > > correctly. I have a much more complex perltidyrc file to try other
>
> > options,
>
> > > but this can repro with a single -baao option
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > > perltidy -st -baao x.pm
>
> > >
>
> > >
>
> > >
>
> > > x.pm:
>
> > >
>
> > > sub x {
>
> > >
>
> > > return 0 ? 'aaaaaaaaaaaaaaaaaaaaa' :
>
> > > 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';
>
> > >
>
> > > }
>
> > >
>
> > > printf x();
>
> > >
>
> > >
>
> > >
>
> > > returns
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > > sub x {
>
> > >
>
> > >
>
> > >
>
> > > return
>
> > >
>
> > >
>
> > >
>
> > > 0 ? 'aaaaaaaaaaaaaaaaaaaaa' :
>
> > >
>
> > >
>
> > >
>
> > > 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';
>
> > >
>
> > >
>
> > >
>
> > > }
>
> > >
>
> > >
>
> > >
>
> > > printf x();
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > > but should return
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > > sub x {
>
> > >
>
> > >
>
> > >
>
> > > return 0 ? 'aaaaaaaaaaaaaaaaaaaaa' :
>
> > >
>
> > >
>
> > >
>
> > > 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';
>
> > >
>
> > >
>
> > >
>
> > > }
>
> > >
>
> > >
>
> > >
>
> > > printf x();
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> >
>
> >
> > > > > > > >
Subject: Re: [rt.cpan.org #127633] Returning ternary operators doesn't break correctly with -baao
Date: Fri, 16 Nov 2018 19:14:55 +0000
To: "bug-Perl-Tidy [...] rt.cpan.org" <bug-Perl-Tidy [...] rt.cpan.org>
From: Todd Richmond <trichmond [...] proofpoint.com>
Great.. It looks like the problem might be a bit more general so not sure if your fix solves this as well. my $s = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' . 'bbbbbbbbbbbbbbbbbbbbbbbbb'; is formatted to my $s = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' . 'bbbbbbbbbbbbbbbbbbbbbbbbb'; Even though 'aaaaa' fits within the 80 column limit and so should be joined with "my $s =". In general, I want every line to get as close to 80 as possible and then break after whatever operator was last. That gets the densest possible code that is also easiest to follow. I tried disabling -baao and using --want-break-after for every operator (with and without =?) but that didn't help Thx again Todd On 11/13/18, 9:04 AM, "Steven Hancock via RT" <bug-Perl-Tidy@rt.cpan.org> wrote: <URL: https://urldefense.proofpoint.com/v2/url?u=https-3A__rt.cpan.org_Ticket_Display.html-3Fid-3D127633&d=DwIDaQ&c=Vxt5e0Osvvt2gflwSlsJ5DmPGcPvTRKLJyp031rXjhg&r=HPS65xby-9P9SqEqfmk6niu-T7bLhV1_QCI7Ml7zCEs&m=R8A16OXyLwXkcmRdCdtELRnPlca8ACeq3Aaeza0BZlk&s=BkbAA5Ga-_p1gli6hBJ6pEFBPUvwIXON2PgsKbSFQK8&e= > I made a patch to fix it. I expect a release in about a week. Steve On Tue, Nov 13, 2018 at 8:55 AM Todd Richmond via RT < bug-Perl-Tidy@rt.cpan.org> wrote: Show quoted text
> Queue: Perl-Tidy > Ticket <URL: https://urldefense.proofpoint.com/v2/url?u=https-3A__rt.cpan.org_Ticket_Display.html-3Fid-3D127633&d=DwIDaQ&c=Vxt5e0Osvvt2gflwSlsJ5DmPGcPvTRKLJyp031rXjhg&r=HPS65xby-9P9SqEqfmk6niu-T7bLhV1_QCI7Ml7zCEs&m=R8A16OXyLwXkcmRdCdtELRnPlca8ACeq3Aaeza0BZlk&s=BkbAA5Ga-_p1gli6hBJ6pEFBPUvwIXON2PgsKbSFQK8&e= > > > Thx for the quick response. It probably shouldn't be a new option since a > return isn't really different than an assignment - style wise. s = b ? > longs1 : longs2 does format correctly > > > > On 11/13/18, 7:14 AM, "Steven Hancock via RT" <bug-Perl-Tidy@rt.cpan.org> > wrote: > > > > <URL: > https://urldefense.proofpoint.com/v2/url?u=https-3A__rt.cpan.org_Ticket_Display.html-3Fid-3D127633&d=DwIDaQ&c=Vxt5e0Osvvt2gflwSlsJ5DmPGcPvTRKLJyp031rXjhg&r=HPS65xby-9P9SqEqfmk6niu-T7bLhV1_QCI7Ml7zCEs&m=KlwyAZD6US6nnQFqrorkX2Wu16XUim5LO2isVgB2KjA&s=ATqt1tfdarRuGDSffM2v4eD2C2LZikM1mgdjayoOiCM&e=
> >
> > > > Todd, > > Sorry, I misunderstood. I don't think there is a flag that can do this; > > I'll look into it. > > Steve > > > > On Tue, Nov 13, 2018 at 6:51 AM Steven Hancock via RT < > > bug-Perl-Tidy@rt.cpan.org> wrote: > > >
> > Queue: Perl-Tidy
>
> > Ticket <URL:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__rt.cpan.org_Ticket_Display.html-3Fid-3D127633&d=DwIDaQ&c=Vxt5e0Osvvt2gflwSlsJ5DmPGcPvTRKLJyp031rXjhg&r=HPS65xby-9P9SqEqfmk6niu-T7bLhV1_QCI7Ml7zCEs&m=KlwyAZD6US6nnQFqrorkX2Wu16XUim5LO2isVgB2KjA&s=ATqt1tfdarRuGDSffM2v4eD2C2LZikM1mgdjayoOiCM&e=
> >
>
> >
>
> > Todd,
>
> > Try adding the flag -wba='?'
>
> > Steve
>
> >
>
> > On Mon, Nov 12, 2018 at 6:16 PM Todd Richmond via RT <
>
> > bug-Perl-Tidy@rt.cpan.org> wrote:
>
> >
>
> > > Mon Nov 12 21:16:04 2018: Request 127633 was acted upon.
>
> > > Transaction: Ticket created by trichmond@proofpoint.com
>
> > > Queue: Perl-Tidy
>
> > > Subject: Returning ternary operators doesn't break correctly
> with >
> > > -baao
>
> > > Broken in: (no value)
>
> > > Severity: (no value)
>
> > > Owner: Nobody
>
> > > Requestors: trichmond@proofpoint.com
>
> > > Status: new
>
> > > Ticket <URL:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__rt.cpan.org_Ticket_Display.html-3Fid-3D127633&d=DwIDaQ&c=Vxt5e0Osvvt2gflwSlsJ5DmPGcPvTRKLJyp031rXjhg&r=HPS65xby-9P9SqEqfmk6niu-T7bLhV1_QCI7Ml7zCEs&m=KlwyAZD6US6nnQFqrorkX2Wu16XUim5LO2isVgB2KjA&s=ATqt1tfdarRuGDSffM2v4eD2C2LZikM1mgdjayoOiCM&e=
> >
>
> > >
>
> > >
>
> > > My coding style is to be as compact as possible and so want ternary
>
> > > operators to break after ? or : - the same as any other single
> operator >
> > to
>
> > > get as close to 80 columns as possible. However, perltidy seems to
> think >
> > > returning a ternary line is a single entity and so breaks before it
>
> > instead
>
> > > of within. Ternary lines that are not part of a return line are
> broken >
> > > correctly. I have a much more complex perltidyrc file to try other
>
> > options,
>
> > > but this can repro with a single -baao option
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > > perltidy -st -baao x.pm
>
> > >
>
> > >
>
> > >
>
> > > x.pm:
>
> > >
>
> > > sub x {
>
> > >
>
> > > return 0 ? 'aaaaaaaaaaaaaaaaaaaaa' :
>
> > > 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';
>
> > >
>
> > > }
>
> > >
>
> > > printf x();
>
> > >
>
> > >
>
> > >
>
> > > returns
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > > sub x {
>
> > >
>
> > >
>
> > >
>
> > > return
>
> > >
>
> > >
>
> > >
>
> > > 0 ? 'aaaaaaaaaaaaaaaaaaaaa' :
>
> > >
>
> > >
>
> > >
>
> > > 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';
>
> > >
>
> > >
>
> > >
>
> > > }
>
> > >
>
> > >
>
> > >
>
> > > printf x();
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > > but should return
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > > sub x {
>
> > >
>
> > >
>
> > >
>
> > > return 0 ? 'aaaaaaaaaaaaaaaaaaaaa' :
>
> > >
>
> > >
>
> > >
>
> > > 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';
>
> > >
>
> > >
>
> > >
>
> > > }
>
> > >
>
> > >
>
> > >
>
> > > printf x();
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> > >
>
> >
>
> >
> > > > > > > >
Subject: Re: [rt.cpan.org #127633] Returning ternary operators doesn't break correctly with -baao
Date: Fri, 16 Nov 2018 12:49:10 -0800
To: bug-Perl-Tidy [...] rt.cpan.org
From: Steven Hancock <s7078hancock [...] gmail.com>
Thanks, I've written a patch for that. Steve On Fri, Nov 16, 2018 at 11:15 AM Todd Richmond 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=127633 > > > Great.. It looks like the problem might be a bit more general so not sure > if your fix solves this as well. > > > > my $s = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' . > 'bbbbbbbbbbbbbbbbbbbbbbbbb'; > > > > is formatted to > > > > my $s = > > 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' . > > 'bbbbbbbbbbbbbbbbbbbbbbbbb'; > > > > Even though 'aaaaa' fits within the 80 column limit and so should be > joined with "my $s =". In general, I want every line to get as close to 80 > as possible and then break after whatever operator was last. That gets the > densest possible code that is also easiest to follow. I tried disabling > -baao and using --want-break-after for every operator (with and without =?) > but that didn't help > > > > Thx again > > Todd > > > > On 11/13/18, 9:04 AM, "Steven Hancock via RT" <bug-Perl-Tidy@rt.cpan.org> > wrote: > > > > <URL: > https://urldefense.proofpoint.com/v2/url?u=https-3A__rt.cpan.org_Ticket_Display.html-3Fid-3D127633&d=DwIDaQ&c=Vxt5e0Osvvt2gflwSlsJ5DmPGcPvTRKLJyp031rXjhg&r=HPS65xby-9P9SqEqfmk6niu-T7bLhV1_QCI7Ml7zCEs&m=R8A16OXyLwXkcmRdCdtELRnPlca8ACeq3Aaeza0BZlk&s=BkbAA5Ga-_p1gli6hBJ6pEFBPUvwIXON2PgsKbSFQK8&e=
> >
> > > > I made a patch to fix it. I expect a release in about a week. > > Steve > > > > On Tue, Nov 13, 2018 at 8:55 AM Todd Richmond via RT < > > bug-Perl-Tidy@rt.cpan.org> wrote: > > >
> > Queue: Perl-Tidy
>
> > Ticket <URL:
> https://urldefense.proofpoint.com/v2/url?u=https-3A__rt.cpan.org_Ticket_Display.html-3Fid-3D127633&d=DwIDaQ&c=Vxt5e0Osvvt2gflwSlsJ5DmPGcPvTRKLJyp031rXjhg&r=HPS65xby-9P9SqEqfmk6niu-T7bLhV1_QCI7Ml7zCEs&m=R8A16OXyLwXkcmRdCdtELRnPlca8ACeq3Aaeza0BZlk&s=BkbAA5Ga-_p1gli6hBJ6pEFBPUvwIXON2PgsKbSFQK8&e=
> >
>
> >
>
> > Thx for the quick response. It probably shouldn't be a new option
> since a >
> > return isn't really different than an assignment - style wise. s = b
> ? >
> > longs1 : longs2 does format correctly
>
> >
>
> >
>
> >
>
> > On 11/13/18, 7:14 AM, "Steven Hancock via RT" <
> bug-Perl-Tidy@rt.cpan.org> >
> > wrote:
>
> >
>
> >
>
> >
>
> > <URL:
>
> >
> https://urldefense.proofpoint.com/v2/url?u=https-3A__rt.cpan.org_Ticket_Display.html-3Fid-3D127633&d=DwIDaQ&c=Vxt5e0Osvvt2gflwSlsJ5DmPGcPvTRKLJyp031rXjhg&r=HPS65xby-9P9SqEqfmk6niu-T7bLhV1_QCI7Ml7zCEs&m=KlwyAZD6US6nnQFqrorkX2Wu16XUim5LO2isVgB2KjA&s=ATqt1tfdarRuGDSffM2v4eD2C2LZikM1mgdjayoOiCM&e= >
> > >
>
> >
>
> >
>
> >
>
> > Todd,
>
> >
>
> > Sorry, I misunderstood. I don't think there is a flag that can
> do this; >
> >
>
> > I'll look into it.
>
> >
>
> > Steve
>
> >
>
> >
>
> >
>
> > On Tue, Nov 13, 2018 at 6:51 AM Steven Hancock via RT <
>
> >
>
> > bug-Perl-Tidy@rt.cpan.org> wrote:
>
> >
>
> >
>
> >
>
> > > Queue: Perl-Tidy
>
> >
>
> > > Ticket <URL:
>
> >
> https://urldefense.proofpoint.com/v2/url?u=https-3A__rt.cpan.org_Ticket_Display.html-3Fid-3D127633&d=DwIDaQ&c=Vxt5e0Osvvt2gflwSlsJ5DmPGcPvTRKLJyp031rXjhg&r=HPS65xby-9P9SqEqfmk6niu-T7bLhV1_QCI7Ml7zCEs&m=KlwyAZD6US6nnQFqrorkX2Wu16XUim5LO2isVgB2KjA&s=ATqt1tfdarRuGDSffM2v4eD2C2LZikM1mgdjayoOiCM&e= >
> > >
>
> >
>
> > >
>
> >
>
> > > Todd,
>
> >
>
> > > Try adding the flag -wba='?'
>
> >
>
> > > Steve
>
> >
>
> > >
>
> >
>
> > > On Mon, Nov 12, 2018 at 6:16 PM Todd Richmond via RT <
>
> >
>
> > > bug-Perl-Tidy@rt.cpan.org> wrote:
>
> >
>
> > >
>
> >
>
> > > > Mon Nov 12 21:16:04 2018: Request 127633 was acted upon.
>
> >
>
> > > > Transaction: Ticket created by trichmond@proofpoint.com
>
> >
>
> > > > Queue: Perl-Tidy
>
> >
>
> > > > Subject: Returning ternary operators doesn't break
> correctly >
> > with
>
> >
>
> > > > -baao
>
> >
>
> > > > Broken in: (no value)
>
> >
>
> > > > Severity: (no value)
>
> >
>
> > > > Owner: Nobody
>
> >
>
> > > > Requestors: trichmond@proofpoint.com
>
> >
>
> > > > Status: new
>
> >
>
> > > > Ticket <URL:
>
> >
> https://urldefense.proofpoint.com/v2/url?u=https-3A__rt.cpan.org_Ticket_Display.html-3Fid-3D127633&d=DwIDaQ&c=Vxt5e0Osvvt2gflwSlsJ5DmPGcPvTRKLJyp031rXjhg&r=HPS65xby-9P9SqEqfmk6niu-T7bLhV1_QCI7Ml7zCEs&m=KlwyAZD6US6nnQFqrorkX2Wu16XUim5LO2isVgB2KjA&s=ATqt1tfdarRuGDSffM2v4eD2C2LZikM1mgdjayoOiCM&e= >
> > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > > My coding style is to be as compact as possible and so want
> ternary >
> >
>
> > > > operators to break after ? or : - the same as any other
> single >
> > operator
>
> >
>
> > > to
>
> >
>
> > > > get as close to 80 columns as possible. However, perltidy
> seems to >
> > think
>
> >
>
> > > > returning a ternary line is a single entity and so breaks
> before it >
> >
>
> > > instead
>
> >
>
> > > > of within. Ternary lines that are not part of a return line
> are >
> > broken
>
> >
>
> > > > correctly. I have a much more complex perltidyrc file to try
> other >
> >
>
> > > options,
>
> >
>
> > > > but this can repro with a single -baao option
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > > perltidy -st -baao x.pm
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > > x.pm:
>
> >
>
> > > >
>
> >
>
> > > > sub x {
>
> >
>
> > > >
>
> >
>
> > > > return 0 ? 'aaaaaaaaaaaaaaaaaaaaa' :
>
> >
>
> > > > 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';
>
> >
>
> > > >
>
> >
>
> > > > }
>
> >
>
> > > >
>
> >
>
> > > > printf x();
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > > returns
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > > sub x {
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > > return
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > > 0 ? 'aaaaaaaaaaaaaaaaaaaaa' :
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > > 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > > }
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > > printf x();
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > > but should return
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > > sub x {
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > > return 0 ? 'aaaaaaaaaaaaaaaaaaaaa' :
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > > 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > > }
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > > printf x();
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
> > > > > > > >

Message body is not shown because it is too large.

This is fixed in perltidy version 20181117.