From 493e6c36d7f445667de0596734b350c3517c78b9 Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Sat, 30 Dec 2023 18:03:09 -0800 Subject: [PATCH] Update perltidy configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update perltidy configuration for Perl critic tests, taking advantage of new perltidy features: add line breaks after labels, enable vertical alignment for => pairs, add trailing commas to multiline lists, and align trailing unless with trailing if. Thanks, Julien ÉLIE. --- NEWS | 6 ++++++ tests/data/perltidyrc | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 303655d..0b41478 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,12 @@ rra-c-util 10.5 (unreleased) to specify an additional list of regular expressions matching files that the check for SPDX license headers should ignore. + Update perltidy configuration for Perl critic tests, taking advantage + of new perltidy features: add line breaks after labels, enable + vertical alignment for => pairs, add trailing commas to multiline + lists, and align trailing unless with trailing if. Thanks, Julien + ÉLIE. + Ignore files created by the Perl Carton tool, JSON files, and temporary files generated by tests when checking for SPDX licenses and Perl strictness in standard tests. diff --git a/tests/data/perltidyrc b/tests/data/perltidyrc index d9967be..6e6ef3f 100644 --- a/tests/data/perltidyrc +++ b/tests/data/perltidyrc @@ -17,6 +17,7 @@ # # SPDX-License-Identifier: FSFAP +-bal=1 # put line breaks after a label -bbao # put line breaks before any operator -bfvt=2 # no newline before "or" after closing brace -nbbc # don't force blank lines before comments (bad for else blocks) @@ -25,8 +26,14 @@ -ce # cuddle braces around else -l=79 # usually use 78, but don't want 79-long lines reformatted -nlop # disable vertical alignment of logical and ternary expressions +-vil='=>' # enable vertical alignment for hash definitions -pt=2 # don't add extra whitespace around parentheses -sbt=2 # ...or square brackets -nsfs # no space before semicolon in for (not that I use this form) --nvc # disable vertical alignment of = and similar symbols -xci # improve indentation of nested structures +-drc # delete repeated commas in a list +-wtc=m # add trailing commas to key => value pairs +-atc # add trailing commas where needed +-dtc # delete trailing commas where needed +-dwic # remove commas interfering with welds +-viu # align trailing unless with if (not that I use unless)