From a131cb30226fa1ae4176e1abd546dc85eb062235 Mon Sep 17 00:00:00 2001 From: ybonatakis Date: Wed, 7 Feb 2024 12:40:25 +0100 Subject: [PATCH] Enable perlcritic checks in CI Run perlcritic against all the perl git files. https://progress.opensuse.org/issues/138416 Signed-off-by: ybonatakis --- .github/workflows/check_critic.yml | 13 +++++++++++++ .perlcriticrc | 1 + main.pm | 3 ++- tests/boot.pm | 3 +-- 4 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/check_critic.yml create mode 120000 .perlcriticrc diff --git a/.github/workflows/check_critic.yml b/.github/workflows/check_critic.yml new file mode 100644 index 0000000..826ff61 --- /dev/null +++ b/.github/workflows/check_critic.yml @@ -0,0 +1,13 @@ +--- +name: perlcritic +on: [push, pull_request] + +jobs: + perlcritic_checks: + runs-on: ubuntu-latest + container: + image: registry.opensuse.org/devel/openqa/containers/os-autoinst_dev + steps: + - uses: actions/checkout@v4 + - name: Static analysis + run: ./external/os-autoinst-common/tools/perlcritic --quiet . diff --git a/.perlcriticrc b/.perlcriticrc new file mode 120000 index 0000000..48360c8 --- /dev/null +++ b/.perlcriticrc @@ -0,0 +1 @@ +external/os-autoinst-common/.perlcriticrc \ No newline at end of file diff --git a/main.pm b/main.pm index 7134c7f..8bba093 100644 --- a/main.pm +++ b/main.pm @@ -1,7 +1,8 @@ # Copyright 2014-2018 SUSE LLC # SPDX-License-Identifier: GPL-2.0-or-later -use strict; + +use Mojo::Base -strict; use testapi; use autotest; diff --git a/tests/boot.pm b/tests/boot.pm index 45ec6b0..95f20f3 100644 --- a/tests/boot.pm +++ b/tests/boot.pm @@ -1,8 +1,7 @@ # Copyright 2014-2018 SUSE LLC # SPDX-License-Identifier: GPL-2.0-or-later -use base 'basetest'; -use strict; +use Mojo::Base 'basetest'; use testapi; sub run {