add support for perltidy and pre-commit

This commit is contained in:
Trevor Cooper 2023-02-12 14:08:52 -08:00
parent ef63522ef9
commit 4bfc29fc69
Signed by: tcooper
GPG Key ID: 52364D7BBCEB35B8
2 changed files with 21 additions and 1 deletions

16
.perltidyrc Normal file
View File

@ -0,0 +1,16 @@
# Workaround needed for handling non-ASCII in files.
# # See <https://github.com/houseabsolute/perl-code-tidyall/issues/84>.
--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 )}

View File

@ -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