HookFunctions: Corrected multiple-match exclude patterns
This commit is contained in:
@ -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=$?
|
||||||
|
|||||||
Reference in New Issue
Block a user