From 44d37e3f9939664d5bbe2562d69a1cc7d230e9d7 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Fri, 28 Jan 2022 16:12:24 -0800 Subject: [PATCH] document -bal=n flag --- bin/perltidy | 18 ++++++++++++++++++ t/snippets/bal.in | 2 +- t/snippets/expect/bal.bal1 | 2 +- t/snippets/expect/bal.bal2 | 2 +- t/snippets/expect/bal.def | 2 +- t/snippets/packing_list.txt | 6 +++--- t/snippets25.t | 4 ++-- t/snippets26.t | 6 +++--- 8 files changed, 30 insertions(+), 12 deletions(-) diff --git a/bin/perltidy b/bin/perltidy index 218e309e..06a13a84 100755 --- a/bin/perltidy +++ b/bin/perltidy @@ -3174,6 +3174,24 @@ with the B<-wba> and B<-wbb> flags. For example, to break before all operators except an B<=> one could use --bbao -wba='=' rather than listing every single perl operator except B<=> on a -wbb flag. +=item B + +This flag controls whether or not a line break occurs after a label. There +are three possible valuse for B: + + -bal=0 break if there is a break in the input [DEFAULt] + -bal=1 always break after a label + -bal=2 never break after a label + +For example, + + # perltidy -bal=1 + RETURN: + return; + + # perltidy -bal=2 + RETURN: return; + =back =head2 Controlling List Formatting diff --git a/t/snippets/bal.in b/t/snippets/bal.in index 9f266d71..387500bb 100644 --- a/t/snippets/bal.in +++ b/t/snippets/bal.in @@ -1,5 +1,5 @@ { L1: L2: - L2: return; + L3: return; }; diff --git a/t/snippets/expect/bal.bal1 b/t/snippets/expect/bal.bal1 index cbc04407..33aabf23 100644 --- a/t/snippets/expect/bal.bal1 +++ b/t/snippets/expect/bal.bal1 @@ -1,6 +1,6 @@ { L1: L2: - L2: + L3: return; }; diff --git a/t/snippets/expect/bal.bal2 b/t/snippets/expect/bal.bal2 index b9f32e3e..149f1cfe 100644 --- a/t/snippets/expect/bal.bal2 +++ b/t/snippets/expect/bal.bal2 @@ -1,3 +1,3 @@ { - L1: L2: L2: return; + L1: L2: L3: return; }; diff --git a/t/snippets/expect/bal.def b/t/snippets/expect/bal.def index 9f266d71..387500bb 100644 --- a/t/snippets/expect/bal.def +++ b/t/snippets/expect/bal.def @@ -1,5 +1,5 @@ { L1: L2: - L2: return; + L3: return; }; diff --git a/t/snippets/packing_list.txt b/t/snippets/packing_list.txt index 774a5880..79792a54 100644 --- a/t/snippets/packing_list.txt +++ b/t/snippets/packing_list.txt @@ -345,6 +345,9 @@ ../snippets25.t vxl.def ../snippets25.t vxl.vxl1 ../snippets25.t vxl.vxl2 +../snippets25.t bal.bal1 +../snippets26.t bal.bal2 +../snippets26.t bal.def ../snippets3.t ce_wn1.ce_wn ../snippets3.t ce_wn1.def ../snippets3.t colin.colin @@ -485,6 +488,3 @@ ../snippets9.t rt98902.def ../snippets9.t rt98902.rt98902 ../snippets9.t rt99961.def -../snippets25.t bal.bal1 -../snippets26.t bal.bal2 -../snippets26.t bal.def diff --git a/t/snippets25.t b/t/snippets25.t index 8c568163..83e2873e 100644 --- a/t/snippets25.t +++ b/t/snippets25.t @@ -87,7 +87,7 @@ BEGIN { { L1: L2: - L2: return; + L3: return; }; ---------- @@ -777,7 +777,7 @@ $co_unused = ($color) ? 'on_green' : 'reverse'; # unused { L1: L2: - L2: + L3: return; }; #19........... diff --git a/t/snippets26.t b/t/snippets26.t index 7869dfeb..7fa76d1f 100644 --- a/t/snippets26.t +++ b/t/snippets26.t @@ -33,7 +33,7 @@ BEGIN { { L1: L2: - L2: return; + L3: return; }; ---------- }; @@ -48,7 +48,7 @@ BEGIN { params => "bal2", expect => <<'#1...........', { - L1: L2: L2: return; + L1: L2: L3: return; }; #1........... }, @@ -60,7 +60,7 @@ BEGIN { { L1: L2: - L2: return; + L3: return; }; #2........... }, -- 2.39.5