Add perltidy to pre-commit linters 82/111382/4 master
authorguillaume.lambert <guillaume.lambert@orange.com>
Sun, 14 Apr 2024 18:36:35 +0000 (20:36 +0200)
committerGuillaume Lambert <guillaume.lambert@orange.com>
Wed, 17 Apr 2024 07:16:55 +0000 (07:16 +0000)
Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: Ie20eb4bc885383deb304363eb8053f8161b3ada1

.pre-commit-config.yaml
tox.ini

index 954379b1e9bce0d377613103bf09127883a63636..10afcad1105ea8314ae71c9cfde0ef307c02d97d 100644 (file)
@@ -28,3 +28,8 @@ repos:
       - id: autopep8
         args: ['--in-place', '--max-line-length=120']
 
+  - repo: https://github.com/perltidy/perltidy
+    rev: '20240202.05'
+    hooks:
+      - id: perltidy
+        stages: [commit]
diff --git a/tox.ini b/tox.ini
index 3514dcf8f79584e438e783196f7dca730fcecc11..73f3460ee563f51e23f57e900dcf715b554608d7 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -403,7 +403,14 @@ commands =
 basepython = python3
 deps = pre-commit
 passenv = HOME
+allowlist_externals = sh
+                      cpan
+                      sudo
+                      which
 commands =
+    sh -c 'which cpan || sudo yum install -y perl-CPAN  \
+        || (echo "cpan command not found - please install it \
+             (e.g. sudo apt-get install perl-modules | yum install perl-CPAN )" >&2 && exit 1)'
     pre-commit run --all-files --show-diff-on-failure
     pre-commit run gitlint-ci --hook-stage manual