File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
.github/workflows/scripts Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -19,17 +19,21 @@ fatal() { error "$@"; exit 1; }
19
19
20
20
test -n " ${UNACCEPTABLE_WORD_LIST:- } " || fatal " UNACCEPTABLE_WORD_LIST unset"
21
21
22
- log " Checking for unacceptable language..."
23
- unacceptable_language_lines=$( git grep \
24
- -i -I -w \
25
- -H -n --column \
26
- -E " ${UNACCEPTABLE_WORD_LIST// / |} " | grep -v " ignore-unacceptable-language"
27
- ) || true | /usr/bin/paste -s -d " " -
22
+ unacceptable_language_lines=
23
+ if [[ -f .unacceptablelanguageignore ]]; then
24
+ log " Found for unacceptable file..."
25
+ log " Checking for unacceptable language..."
26
+ unacceptable_language_lines=$( tr ' \n' ' \0' < .unacceptablelanguageignore | xargs -0 -I% printf ' ":(exclude)%" ' | xargs git grep -i -I -w -H -n --column -E " ${UNACCEPTABLE_WORD_LIST// / |} " | grep -v " ignore-unacceptable-language" ) || true | /usr/bin/paste -s -d " " -
27
+ else
28
+ log " Checking for unacceptable language..."
29
+ unacceptable_language_lines=$( git grep -i -I -w -H -n --column -E " ${UNACCEPTABLE_WORD_LIST// / |} " | grep -v " ignore-unacceptable-language" ) || true | /usr/bin/paste -s -d " " -
30
+ fi
28
31
29
32
if [ -n " ${unacceptable_language_lines} " ]; then
30
33
fatal " ❌ Found unacceptable language:
31
34
${unacceptable_language_lines}
32
35
"
33
36
fi
34
37
38
+
35
39
log " ✅ Found no unacceptable language."
You can’t perform that action at this time.
0 commit comments