chore: linters: limit to known directories

pull/472/head
Stéphane Lesimple 2 years ago committed by Stéphane Lesimple
parent 29437466dd
commit b971aa03fb

@ -9,7 +9,7 @@ cd "$basedir" || exit 1
action_doing "Checking perlcritic"
# shellcheck disable=SC2086
perlcritic --color -q -p "$(dirname "$0")"/perlcriticrc .; ret1=$?
perlcritic --color -q -p "$(dirname "$0")"/perlcriticrc bin contrib docker install lib tests; ret1=$?
perlcritic --color -q -p "$(dirname "$0")"/perlcriticrc lib/perl/OVH/Bastion/*.inc; ret2=$?
if [ "$ret1" = 0 ] && [ "$ret2" = 0 ]; then
# shellcheck disable=SC2119

@ -41,7 +41,8 @@ params="$params \
# run on all perl files (".") or only the $2 file if specified
# shellcheck disable=SC2086
find "${2:-.}" -type f ! -name "*.tdy" ! -name "*.ERR" ! -name "*.tidybak" ! -name "*.html" ! -name "$(basename "$0")" -print0 | \
find ${2:-bin contrib docker install lib tests} -type f \
! -name "*.tdy" ! -name "*.ERR" ! -name "*.tidybak" ! -name "*.html" ! -name "$(basename "$0")" -print0 | \
xargs -r0 grep -l 'set filetype=perl' -- | \
xargs -r perltidy $params

@ -46,7 +46,9 @@ else
action_doing "Checking shell files syntax using system shellcheck"
fi
for i in $(find "${2:-.}" -type f ! -name "*.swp" ! -name "*.orig" ! -name "*.rej" -print0 | xargs -r0 grep -l 'set filetype=sh' | sort)
for i in $(find ${2:-bin contrib docker install lib tests} -type f \
! -name "*.swp" ! -name "*.orig" ! -name "*.rej" ! -name "$(basename "$0")" -print0 \
| xargs -r0 grep -l 'set filetype=sh' | sort)
do
run_shellcheck "$i"; ret=$?
if [ $ret != 0 ]; then

Loading…
Cancel
Save