File: check-shell-scripts.sh

package info (click to toggle)
samba 2%3A4.23.5%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 188,188 kB
  • sloc: ansic: 2,007,646; python: 272,677; sh: 72,350; xml: 51,676; perl: 36,094; makefile: 6,353; yacc: 5,324; exp: 1,582; lex: 1,504; cpp: 1,224; awk: 589; java: 119; csh: 58; pascal: 54; sed: 45; asm: 30
file content (20 lines) | stat: -rwxr-xr-x 320 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

if [ $# -lt 1 ]; then
	echo "Usage: $(basename "${0}") DIR [SEVERITY]"
	exit 1
fi

DIR="${1}"
SEVERITY="${2:-error}"

shfmt -f "${DIR}" |
	grep -v -E "(bootstrap|third_party)" |
	xargs shellcheck \
		--shell=sh \
		--external-sources \
		--check-sourced \
		--format=gcc \
		--severity="${SEVERITY}"

exit $?