From d88b9bcdafe9d19aad2fb120d0a0acb3edab64f7 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 8 Apr 2024 13:49:23 +0000 Subject: [PATCH] ci: add shellcheck job and script Add FIXME for OS/400 scripts. Cherry-picked from #1358 --- .github/workflows/ci.yml | 8 ++++++++ ci/shellcheck.sh | 12 ++++++++++++ 2 files changed, 20 insertions(+) create mode 100755 ci/shellcheck.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d1aa1a07..37cb0065 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,14 @@ jobs: - name: 'checksrc' run: ./ci/checksrc.sh + shellcheck: + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@v4 + - name: 'shellcheck' + run: ./ci/shellcheck.sh + spellcheck: runs-on: ubuntu-latest steps: diff --git a/ci/shellcheck.sh b/ci/shellcheck.sh new file mode 100755 index 00000000..2d37c49a --- /dev/null +++ b/ci/shellcheck.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# Copyright (C) Viktor Szakats +# +# SPDX-License-Identifier: curl + +# FIXME: os400/* scripts + +shellcheck --version +# shellcheck disable=SC2046 +shellcheck --exclude=1091 \ + --enable=avoid-nullary-conditions,deprecate-which \ + $(grep -l -E '^#!(/usr/bin/env bash|/bin/sh|/bin/bash)' $(git ls-files | grep -v -F 'os400/'))