File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed
Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -23,16 +23,23 @@ while IFS=: read -r filepath link; do
2323 status=1
2424 fi
2525done < <(
26- git --no-pager grep --no-color -I -P -o \
27- ' (?!.*@lint-ignore)(?:\[[^]]+\]\([^[:space:])]*/[^[:space:])]*\)|href="[^"]*/[^"]*"|src="[^"]*/[^"]*")' \
28- -- ' *' \
29- ' :(exclude).*' \
30- ' :(exclude)**/.*' \
31- ' :(exclude)**/*.lock' \
32- ' :(exclude)**/*.svg' \
33- ' :(exclude)**/*.xml' \
34- ' :(exclude,glob)**/third-party/**' \
35- ' :(exclude,glob)**/third_party/**' \
26+ pattern=' (?!.*@lint-ignore)(?:\[[^]]+\]\([^[:space:]\)]+/[^[:space:]\)]+\)|href="[^"]*/[^"]*"|src="[^"]*/[^"]*")'
27+ excludes=(
28+ ' :(exclude,glob)**/.*'
29+ ' :(exclude,glob)**/*.lock'
30+ ' :(exclude,glob)**/*.svg'
31+ ' :(exclude,glob)**/*.xml'
32+ ' :(exclude,glob)**/*.gradle*'
33+ ' :(exclude,glob)**/*gradle*'
34+ ' :(exclude,glob)**/third-party/**'
35+ ' :(exclude,glob)**/third_party/**'
36+ )
37+ if [ $# -gt 0 ]; then
38+ paths=(" $@ " )
39+ else
40+ paths=(' *' )
41+ fi
42+ git --no-pager grep --no-color -I -P -o " $pattern " -- " ${paths[@]} " " ${excludes[@]} " \
3643 | grep -Ev ' https?://' \
3744 | sed -E \
3845 -e ' s#([^:]+):\[[^]]+\]\(([^)]+)\)#\1:\2#' \
You can’t perform that action at this time.
0 commit comments