From 8eba1b600607784bccfba0b5d28f79db4315a206 Mon Sep 17 00:00:00 2001 From: Yuming Long <63475068+yuming-long@users.noreply.github.com> Date: Thu, 29 Sep 2022 15:24:28 -0400 Subject: [PATCH] feat: Add shellcheck to CI and Make target (#10) --- .github/workflows/ci.yml | 7 +++++++ Makefile | 6 ++++++ scripts/shellcheck.sh | 4 ++++ 3 files changed, 17 insertions(+) create mode 100755 scripts/shellcheck.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80bbe8a2f..a479416f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,6 +57,13 @@ jobs: source .venv/bin/activate make check + shellcheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: ShellCheck + uses: ludeeus/action-shellcheck@master + test: runs-on: ubuntu-latest env: diff --git a/Makefile b/Makefile index d5ceee69d..520f6874d 100644 --- a/Makefile +++ b/Makefile @@ -109,6 +109,12 @@ check-tests: black --line-length 100 test_${PACKAGE_NAME} --check flake8 test_${PACKAGE_NAME} +## check-scripts: run shellcheck +.PHONY: check-scripts +check-scripts: + # Fail if any of these files have warnings + scripts/shellcheck.sh + ## tidy: run black .PHONY: tidy tidy: diff --git a/scripts/shellcheck.sh b/scripts/shellcheck.sh new file mode 100755 index 000000000..bbb3186dd --- /dev/null +++ b/scripts/shellcheck.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +find scripts -name "*.sh" -exec shellcheck {} + +