From: Dominik Rusovac <d.rusovac@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH proxmox-perltidy] drop blank lines directly after opening block brace
Date: Thu, 26 Nov 2026 09:55:01 +0100 [thread overview]
Message-ID: <20261126085501.1026600-1-d.rusovac@proxmox.com> (raw)
the consensus seems to be that the absence of blanks right after the
opening brace of a block should be enforced [0]
use --keep-old-blank-lines-exceptions='{b' to ignore such blanks when
reading the input, so they are removed from the output; by default this
only applies to `sub` blocks. to cover all block types, also set
--blank-lines-after-opening-block-list='*'
to avoid inserting blanks after the opening brace of the covered block
types, explicitly set --blank-lines-after-opening-block to its default
of 0
--keep-old-blank-lines-exceptions needs perltidy >= 20250214, which
however adds no new requirement, since --cuddled-paren-brace-weld
already needs 20250311.05
[0] lore.proxmox.com/all/20261119124402.1822168-1-d.rusovac@proxmox.com/T
Signed-off-by: Dominik Rusovac <d.rusovac@proxmox.com>
---
src/perltidyrc | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/perltidyrc b/src/perltidyrc
index ee2ad46..5161cae 100644
--- a/src/perltidyrc
+++ b/src/perltidyrc
@@ -68,6 +68,9 @@
--keep-old-blank-lines=1 # keep old blank lines if the amount is smaller than max. consecutive below
--maximum-consecutive-blank-lines=1 # hard-code the default
+--keep-old-blank-lines-exceptions='{b' # drop blank lines directly after an opening block brace, needs perltidy >= 20250214
+--blank-lines-after-opening-block-list='*' # apply the above to all block types, not just subs
+--blank-lines-after-opening-block=0 # hard-code the default, never insert blank lines after an opening brace
# Control structure formatting
--cuddled-blocks # avoid extra line for else, elsif, ...
--
2.47.3
reply other threads:[~2026-11-26 8:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261126085501.1026600-1-d.rusovac@proxmox.com \
--to=d.rusovac@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox