Sorry, I see I didn't completely answer your question. The -fnl flag is
supposed to just keep the same
line breaks but doesn't control semicolon addition, since they do not
change line breaks.
So as part of correcting the semicolon control logic the semicolons are now
being added, which I think is how it should be.
Steve
On Tue, Feb 27, 2018 at 6:33 AM, Steven Hancock <s7078hancock@gmail.com>
wrote:
Show quoted text> Yes, there was a change to the semicolon coding to make it more closely
> follow the intention of the flag.
> The control for this is -asc, which is the default:
>
> -asc, --add-semicolons
> Setting -asc allows perltidy to add any missing optional
> semicolon at the end of a line
> which is followed by a closing curly brace on the next line.
> This is the default, and
> may be deactivated with -nasc or --noadd-semicolons
>
> So this is what happens in your example. The coding change which was made
> was to change the
> meaning of "next line" in this text to be "next line of code". The
> previous version would have given the same result as
> the latest version if you had put a newline at the end of your test
> snippet.
>
> The previous version would add a semicolon for this snippet:
> if (foo) {
> bar
> }
>
> but not for this snippet:
>
> if (foo) {
> bar
>
> }
>
> because of the blank line. The current version will add the semicolon in
> both cases.
>
>
> Using -nasc is the way to avoid adding semicolons.
>
> I am thinking about adding some more refined semicolon controls in the
> future.
> Steve
>
> On Tue, Feb 27, 2018 at 3:54 AM, Petr Pisar via RT <
> bug-Perl-Tidy@rt.cpan.org> wrote:
>
>> Tue Feb 27 06:54:49 2018: Request 124605 was acted upon.
>> Transaction: Ticket created by ppisar
>> Queue: Perl-Tidy
>> Subject: -fnl inserts semicolon before a curly bracket
>> Broken in: 20180219
>> Severity: (no value)
>> Owner: Nobody
>> Requestors: ppisar@redhat.com
>> Status: new
>> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=124605 >
>>
>>
>> With Perl-Tidy-20180101:
>>
>> $ printf 'if (foo) {\nbar\n}' | perltidy -fnl
>> if (foo) {
>> bar
>> }
>>
>> With Perl-Tidy-20180220:
>>
>> $ printf 'if (foo) {\nbar\n}' | perltidy -fnl
>>
>> if (foo) {
>> bar;
>> }
>>
>> Adding -nasc helps. Is this change intentional?
>>
>
>