# Default options for perltidy for proper Perl code reformatting.
#
# The canonical version of this file is maintained in the rra-c-util package,
# which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
#
# Written by Russ Allbery <eagle@eyrie.org>
# Copyright 2021-2025 Russ Allbery <eagle@eyrie.org>
# Copyright 2012-2013
#     The Board of Trustees of the Leland Stanford Junior University
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice and
# this notice are preserved.  This file is offered as-is, without any
# warranty.
#
# SPDX-License-Identifier: FSFAP
#
# Changed for scala-debian-helper, which is indented like debhelper: one tab per level,
# continuation lines two spaces after it. See the end of the file; -bal, -l
# and -vil were changed in place.

-bal=0          # scala-debian-helper: labels as written (SKIP: { of Test::More)
-bbao           # put line breaks before any operator
-cpb            # put opening brace on same line as closing paren
-ce             # cuddle braces around else
-bfvt=2         # no newline before "or" after closing brace
-nwn            # do not weld for multiline formatting (closer to Python black)
-nbbc           # don't force blank lines before comments (bad for else blocks)
-boc            # do not re-break lists, since perltidy is awful at this
-kbb=')'        # please, please stop trying to cuddle closing function parens
-l=100          # scala-debian-helper: tabs count 8 columns; 79 breaks nested code badly
-nlop           # disable vertical alignment of logical and ternary expressions
-vxl='=> , =~ !~ if unless'  # scala-debian-helper: no alignment of these; with
                # several pairs on a line it makes wide gaps
-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)
-nwrs='A'       # don't add a space between a colon and an attribute
-xci            # improve indentation of nested structures
-mci            # minimize continuation indentation
-qwaf           # format qw lists using parentheses like function calls
-drc            # delete repeated commas in a list
-wtc=m          # add trailing commas to all multi-line lists
-atc            # add trailing commas where needed
-dtc            # delete trailing commas where needed
-altc           # add trailing comma to long arguments (perlcritic needs this)
-dwic           # delete commas that interfere with welding
-dia            # delete interbracket arrows
-viu            # align trailing unless with if (not that I use unless)

# scala-debian-helper: indentation and long lines.
-i=8            # one level is 8 columns...
-et=8           # ...written as one tab; continuation stays tab + 2 spaces
-nolc           # keep long comments at their block's indentation
-nolq           # same for long quotes
-wba='=~ !~ = .= //= ||= += -= *= x= &&='  # break after these, not before
-conv           # iterate until the output no longer changes, so that one run
                # of t/tidy.t agrees with it
