Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: perl [...] toby.ink
Cc:
AdminCc:

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



Subject: delete-old-newlines selectively
I want to be able to use delete-old-newlines in general, but there are certain patterns where I want to keep them, like: method 'foo' => [ Int, Int ] => sub { my ( $self, $x, $y ) = ( shift, @_ ); ...; }; So it would be nice to have something like: --keep-old-newlines-before-tokens='=>' Probably a corresponding keep-old-newlines-after-tokens too.
This looks like a useful option, I will look into adding it.
This feature is implemented with new parameters -keep-old-breakpoints-before=s, or -kbb=s and --keep-old-breakpoints-after=s, or -kba=s, where s is a list of token types such as '=>'. It will be in the next release to CPAN and is in the test version 20201001.03 at https://github.com/perltidy/perltidy/releases
Version 20201202 has been released and the suggested new flags -kba=s and -kbb=s.