From: guillaume.lambert Date: Sun, 14 Apr 2024 18:36:35 +0000 (+0200) Subject: Add perltidy to pre-commit linters X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=transportpce.git;a=commitdiff_plain;h=HEAD Add perltidy to pre-commit linters Signed-off-by: guillaume.lambert Change-Id: Ie20eb4bc885383deb304363eb8053f8161b3ada1 --- diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 954379b1e..10afcad11 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 3514dcf8f..73f3460ee 100644 --- 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