문제

I have a code snippet like:

my $a_box = [
    [$a11, $a12, $a13, $a14, $a15, $a16],
    [$a21, $a22, $a23, $a24, $a25, $a26],
    [$a31, $a32, $a33, $a34, $a35, $a36],
    [$a41, $a42, $a43, $a44, $a45, $a46],
    [$a51, $a52, $a53, $a54, $a55, $a56],
    [$a61, $a62, $a63, $a64, $a65, $a66],
];

is there any option in perltidy can make it break before the bracket like this:

my $a_box = 
[
    [$a11, $a12, $a13, $a14, $a15, $a16],
    [$a21, $a22, $a23, $a24, $a25, $a26],
    [$a31, $a32, $a33, $a34, $a35, $a36],
    [$a41, $a42, $a43, $a44, $a45, $a46],
    [$a51, $a52, $a53, $a54, $a55, $a56],
    [$a61, $a62, $a63, $a64, $a65, $a66],
];

any suggestion is appreciated, thanks!

도움이 되었습니까?

해결책

There is no such option in the Perl Tidy manpage. You can control if there is a newline after that bracket, but not before. There is the -bli option that controls the break before opening blocks of subs, but it does not affect lists and arrays.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top