From 4bfc29fc691568f36391560818fca0e7a3f7cac7 Mon Sep 17 00:00:00 2001 From: Trevor Cooper Date: Sun, 12 Feb 2023 14:08:52 -0800 Subject: [PATCH] add support for perltidy and pre-commit --- .perltidyrc | 16 ++++++++++++++++ .pre-commit-config.yaml | 6 +++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .perltidyrc diff --git a/.perltidyrc b/.perltidyrc new file mode 100644 index 00000000..66964422 --- /dev/null +++ b/.perltidyrc @@ -0,0 +1,16 @@ +# Workaround needed for handling non-ASCII in files. +# # See . +--character-encoding=none +--no-valign +# 120 characters would be desired but it is not feasible right now +#-l=120 # 120 characters per line +-l=160 +-fbl # don't change blank lines +-fnl # don't remove new lines +-nsfs # no spaces before semicolons +-baao # space after operators +-bbao # space before operators +-pt=2 # no spaces around () +-bt=2 # no spaces around [] +-sbt=2 # no spaces around {} +-sct # stack closing tokens )} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 852cdc4a..cb82a064 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,9 +1,13 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v3.2.0 + rev: v4.4.0 hooks: - id: trailing-whitespace - id: end-of-file-fixer - id: check-json - id: check-yaml - id: check-added-large-files +- repo: https://github.com/henryykt/pre-commit-perl + rev: v0.0.5 + hooks: + - id: perltidy