From f5d228e28e810f6ced8429bda2d1a0fe7c237918 Mon Sep 17 00:00:00 2001 From: Dirk Wetter Date: Mon, 31 Aug 2026 20:05:30 +0200 Subject: [PATCH] Add Perl static analysis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Run perl -c on every t/*.t file as a fast pre-check before prove. * Add Perl::Critic (a curated policy set) and perltidy --check for the Perl test code — the repo lints its bash with shellcheck but has zero linting for its Perl. * Add Test::NoWarnings (and/or Test::Fatal) to the test harness so warnings/exceptions in the code under test fail the build. Not yet sure about using the hash / SHA-pinning. To be reconsidered later --- .github/workflows/perl-quality.yml | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/perl-quality.yml diff --git a/.github/workflows/perl-quality.yml b/.github/workflows/perl-quality.yml new file mode 100644 index 0000000..be0be47 --- /dev/null +++ b/.github/workflows/perl-quality.yml @@ -0,0 +1,38 @@ +name: Perl quality + +on: + pull_request: + paths: + - 't/**' + - 'cpanfile' + - '.perlcritic' + - '.github/workflows/perl-quality.yml' + +permissions: + contents: read + +jobs: + perl: + runs-on: ubuntu-24.04 + timeout-minutes: 10 + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: shivammathur/setup-perl@v14 + with: + perl-version: '5.38' + - name: Install dev modules + run: cpanm --notest Perl::Critic perltidy cpan-audit + - name: Syntax check all test files + run: | + find t -name '*.t' -o -name '*.pm' | while read -r f; do + perl -I t/lib -c "$f" + done + - name: Perl::Critic + run: perlcritic --verbose '%f:%l:%e:%m\n' t/ + - name: perltidy (fail on diff) + run: | + perltidy -p t/ + git diff --exit-code + - name: Audit CPAN modules for known CVEs + run: cpan-audit +