From 8323fbfc7bf0e52b75d8e7f3c34d0ce68f6cad6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Mon, 16 Dec 2024 12:03:05 +0100 Subject: [PATCH] Add shellcheck github-action and .shellcheckrc --- .github/workflows/shellcheck.yml | 30 ++++++++++++++++++++++++++++++ .shellcheckrc | 11 +++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .github/workflows/shellcheck.yml create mode 100644 .shellcheckrc diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml new file mode 100644 index 0000000000..dd61190fa6 --- /dev/null +++ b/.github/workflows/shellcheck.yml @@ -0,0 +1,30 @@ +name: Run Shellcheck on push and PR + +on: + push: + pull_request: + +jobs: + shellcheck: + name: Shellcheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Run ShellCheck + uses: salamandar/action-shellcheck@master + env: + SHELLCHECK_OPTS: -x -e SC2155 + with: + additional_files: | + bin/yunoprompt + debian/postinst + debian/postrm + debian/prerm + hooks/*/* + tests + helpers/helpers.v2.1.d/* + + ignore_paths: + tests/test_helpers.v2.d + helpers/vendor + src/vendor diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 0000000000..b8b7245f07 --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1,11 @@ +external-sources=true +source-path=SCRIPTDIR + +# Declare and assign separately +disable=SC2155 + +# In case cd / pushd / popd fails +disable=SC2164 + +# Useless cat when sed/grep +disable=SC2002