HookFunctions: Corrected multiple-match exclude patterns

This commit is contained in:
Will Bainbridge
2019-10-31 14:17:10 +00:00
parent c1820f19d3
commit a3b67ff44e

View File

@ -185,6 +185,8 @@ checkPattern() # scope, pattern, include, exclude, files...
exclude="$1" exclude="$1"
shift shift
shopt -s extglob
# Loop files, accumulating errors # Loop files, accumulating errors
for file in "$@" for file in "$@"
do do
@ -223,7 +225,7 @@ checkTabs() # scope, files...
shift shift
pattern="-e $'\t'" pattern="-e $'\t'"
include="*" include="*"
exclude="*[Mm]akefile* | wmake/rules/* | bin/tools/gtagsrc | *.f* | *.v[cf]proj | *.pdf | *.png | *.html | *.gif | *.css | *.gz" exclude="@(*[Mm]akefile*|wmake/rules/*|bin/tools/gtagsrc|*.html|*.css|*.pdf|*.png|*.gz)"
errorMessages="$(checkPattern "$scope" "$pattern" "$include" "$exclude" "$@")" errorMessages="$(checkPattern "$scope" "$pattern" "$include" "$exclude" "$@")"
errorCount=$? errorCount=$?
@ -243,7 +245,7 @@ checkLineEnds() # scope, files...
shift shift
pattern="-e \"[ ]+$\" --or -e $'\r'" pattern="-e \"[ ]+$\" --or -e $'\r'"
include="*" include="*"
exclude="*.md" exclude="@(*.md|*.pdf|*.png|*.gz)"
errorMessages="$(checkPattern "$scope" "$pattern" "$include" "$exclude" "$@")" errorMessages="$(checkPattern "$scope" "$pattern" "$include" "$exclude" "$@")"
errorCount=$? errorCount=$?