diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2020-06-11 22:10:07 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2020-06-11 23:19:34 +0200 |
| commit | 588020678f34b89925fcfbcaf8f635c5850e8e7a (patch) | |
| tree | 0d0467180954d05e261681124088a1025f90cc58 /tools/check-language.sh | |
| parent | 829fd56fbf6fc9243f8ac969c7c58172e5adcb45 (diff) | |
all: use more respective language
Some terms are normalised on the technical level
but may be oppressive on a societal level.
Replace them with more technically neutral terms.
See the following doc for a longer version:
https://tools.ietf.org/id/draft-knodel-terminology-00.html
Diffstat (limited to 'tools/check-language.sh')
| -rwxr-xr-x | tools/check-language.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tools/check-language.sh b/tools/check-language.sh new file mode 100755 index 000000000..b99404be6 --- /dev/null +++ b/tools/check-language.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +# Copyright 2020 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +FILES=0 +FAILED="" +shopt -s nocasematch +for F in $(find . -name "*.go" -o -name "*.sh" -o -name "*.cc" -o -name "*.md" \ + -o -name "*.S" -o -name "*.py" -o -name "*.yml" -o -name "*.yaml" | \ + egrep -v "/vendor/|/gen/|executor/syscalls.h|pkg/csource/generated.go|tools/check-language.sh"); do + ((FILES+=1)) + L=0 + while IFS= read -r LINE; do + ((L+=1)) + if [[ $LINE =~ (slave|blacklist|whitelist) ]]; then + if [[ $LINE =~ bond_enslave ]]; then + continue + fi + SUGGESTIONS="block/allow/ignore/skip" + if [[ $LINE =~ (slave) ]]; then + SUGGESTIONS="leader/follower/coordinator/worker/parent/helper" + fi + echo "$F:$L:1: Please use more respectful terminology, consider using ${SUGGESTIONS} instead." \ + "See https://tools.ietf.org/id/draft-knodel-terminology-00.html for more info." + echo "$LINE" + FAILED="1" + fi + done < "$F" +done +if [ "$FAILED" != "" ]; then exit 1; fi +echo "$FILES files checked" >&2 |
