-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
check_distribution.sh
executable file
·51 lines (45 loc) · 1.28 KB
/
check_distribution.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
PERL_FILES="check_rbl t/*.t"
FILES="${PERL_FILES} AUTHORS COPYING COPYRIGHT Changes INSTALL Makefile.PL NEWS README.md TODO check_distribution.sh test_script.sh"
echo "Perl::Critic"
echo "============"
echo
# shellcheck disable=SC2086
perlcritic -1 ${PERL_FILES}
echo
echo "Formatting errors: tabs"
echo "======================="
echo
# shellcheck disable=SC2086
grep --line-number "$(printf '\t')" ${FILES}
echo
echo "Formatting errors: blanks at the end of line"
echo "============================================"
echo
# shellcheck disable=SC2086
grep --line-number '[[:blank:]]$' ${FILES}
echo
echo "ShellCheck"
echo "=========="
echo
SHELLCHECK=$(command -v shellcheck 2>/dev/null)
if [ -z "${SHELLCHECK}" ]; then
echo "No shellcheck installed: skipping test"
else
if shellcheck --help 2>&1 | grep -q -- '-o\ '; then
shellcheck -o all ./check_distribution.sh ./test_script.sh
else
shellcheck ./check_distribution.sh ./test_script.sh
fi
fi
YEAR=$(date +"%Y")
echo "Copyright (${YEAR})"
echo "========="
echo
echo '### README.md'
grep "© Matteo Corti, 2009-${YEAR}" README.md
echo '### COPYRIGHT'
grep "Copyright (c) 2009-${YEAR} Matteo Corti" COPYRIGHT
echo '### check_rbl'
grep "Copyright (c) 2009-${YEAR} Matteo Corti <[email protected]>" check_rbl
echo