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:
> 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:
>
> >
>
> >
>
> >
>
>
> >
>
>
> >
>
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=
>
>
> >
>
>
> >
>
>
> >
>
> > > Try adding the flag -wba='?'
>
> >
>
>
> >
>
>
> >
>
> > > 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
>
> >
>
>
> >
>
> > > > Subject: Returning ternary operators doesn't break
> correctly
>
> > with
>
> >
>
>
> >
>
> > > > Broken in: (no value)
>
> >
>
> > > > Severity: (no value)
>
> >
>
>
> >
>
> > > > Requestors: trichmond@proofpoint.com
>
> >
>
>
> >
>
>
> >
>
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
>
> >
>
>
> >
>
> > > > 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
>
> >
>
>
> >
>
> > > > 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
>
> >
>
>
> >
>
> > > > but this can repro with a single -baao option
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
> > > > perltidy -st -baao x.pm
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
> > > > return 0 ? 'aaaaaaaaaaaaaaaaaaaaa' :
>
> >
>
> > > > 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
> > > > 0 ? 'aaaaaaaaaaaaaaaaaaaaa' :
>
> >
>
>
> >
>
>
> >
>
>
> >
>
> > > > 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
> > > > but should return
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
> > > > return 0 ? 'aaaaaaaaaaaaaaaaaaaaa' :
>
> >
>
>
> >
>
>
> >
>
>
> >
>
> > > > 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb';
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
>
>
>
>
>
>
>