File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -34,3 +34,6 @@ PHPMD_SUFFIXES=php
3434
3535# PHP Mess Detector list of files/folders to exclude
3636PHPMD_EXCLUDE=
37+
38+ # List of file patterns to exclude (using `grep`)
39+ GIT_EXCLUDE="Test"
Original file line number Diff line number Diff line change 4444
4545# This is the magic:
4646# Retrieve all files in staging area that are added, modified or renamed
47- # but no deletions etc
48- FILES=$( git diff-index --name-only --cached --diff-filter=ACMR $against -- )
47+ # but no deletions etc.
48+ # Lets first check if there are any file pattern to exclude from this list
49+ if [ " $GIT_EXCLUDE " != " " ]; then
50+ GIT_EXCLUDE_LIST=" | grep -v $GIT_EXCLUDE "
51+ else
52+ GIT_EXCLUDE_LIST=" "
53+ fi
54+
55+ FILES=$( git diff-index --name-only --cached --diff-filter=ACMR $against -- $GIT_EXCLUDE_LIST )
4956
5057if [ " $FILES " == " " ]; then
5158 exit 0
You can’t perform that action at this time.
0 commit comments