Skip to content
Snippets Groups Projects
Commit efc283d7 authored by Trond Aasan's avatar Trond Aasan
Browse files

Add shell script linting

parent df1f7f32
No related branches found
No related tags found
1 merge request!3Add shell script linting
Pipeline #56491 failed
stages:
- linting
shellcheck:
stage: linting
image: pipelinecomponents/shellcheck:latest
script:
# anything ending on .sh, should be shell script
- |
find . -name .git -type d -prune -o -type f -name \*.sh -print0 |
xargs -0 -P $(nproc) -r -n1 shellcheck
# magic, any file with a valid shebang should be scanned aswell
- |
find . -name .git -type d -prune -o -type f -regex '.*/[^.]*$' -print0 |
xargs -0 -P $(nproc) -r -n1 sh -c 'FILE="$0"; if head -n1 "$FILE" |grep -q "^#\\! \?/.\+\(ba|d|k\)\?sh" ; then shellcheck "$FILE" ; else /bin/true ; fi '
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment