mirror of
https://github.com/bensuperpc/dockcross.git
synced 2024-12-22 16:24:27 +01:00
Add shellcheck
Add shellcheck CI and shellcheck in Makefile (bash-check rule) Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
This commit is contained in:
parent
c1526555a5
commit
882a67b9d2
26
.github/workflows/shellcheck.yml
vendored
Normal file
26
.github/workflows/shellcheck.yml
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
name: Shellcheck CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '*'
|
||||
paths-ignore:
|
||||
- '**/README.md'
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
paths-ignore:
|
||||
- '**/README.md'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
shellcheck:
|
||||
name: Shellcheck
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Run ShellCheck
|
||||
uses: ludeeus/action-shellcheck@master
|
||||
with:
|
||||
severity: warning
|
||||
format: gcc
|
11
Makefile
11
Makefile
@ -50,6 +50,12 @@ endif
|
||||
# Tag images with date and Git short hash in addition to revision
|
||||
TAG := $(shell date '+%Y%m%d')-$(shell git rev-parse --short HEAD)
|
||||
|
||||
# shellcheck executable
|
||||
SHELLCHECK := shellcheck
|
||||
|
||||
# Defines the level of verification (error, warning, info...)
|
||||
SHELLCHECK_SEVERITY_LEVEL := error
|
||||
|
||||
#
|
||||
# images: This target builds all IMAGES (because it is the first one, it is built by default)
|
||||
#
|
||||
@ -275,6 +281,11 @@ purge: clean
|
||||
# Remove all images with organization (ex dockcross/*)
|
||||
$(DOCKER) images --filter=reference='$(ORG)/*' --format='{{.Repository}}:{{.Tag}}' | xargs -r $(DOCKER) rmi -f
|
||||
|
||||
# Check bash syntax
|
||||
bash-check:
|
||||
find . -type f \( -name "*.sh" -o -name "*.bash" \) -print0 | xargs -0 -P"$(shell nproc)" -I{} \
|
||||
$(SHELLCHECK) --check-sourced --color=auto --format=gcc --severity=error --shell=bash --enable=all "{}"
|
||||
|
||||
#
|
||||
# testing implicit rule
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user