Skip to content

Commit

Permalink
add shellcheck script and workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Marklund <[email protected]>
  • Loading branch information
trollkarlen committed Jan 23, 2025
1 parent 6626b26 commit d3ea8a8
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: run shellcheck on scripts

on:
push:
branches:
- main
- devel
pull_request:


jobs:
build:
name: Runs the shellcheck on scripts
runs-on: ubuntu-24.04

steps:
- name: checkout
uses: actions/checkout@v4
- name: install packages
run: sudo apt install shellcheck
- name: run shellcheck
run: ./do_shellcheck.sh
21 changes: 21 additions & 0 deletions do_shellcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

set -e

me=$(basename "$0")


echo "$me: run shellcheck on shellscripts"
(
# use this when all issues are fixed
# git ls-files | grep -v "^testcases" | grep -E ".sh$" | xargs shellcheck
shellcheck do_shellcheck.sh
)

echo "$me: run shellcheck on testcases"
(
# use this when all issues are fixed
# cd testcases && git ls-files | grep -E ".sh$" | xargs shellcheck -x
cd testcases && shellcheck -x ./checksum_buffersize*.sh
)

0 comments on commit d3ea8a8

Please sign in to comment.