Skip to content

Commit cc3033f

Browse files
ktosoyim-lee
andauthored
Use inclusive language (#37)
* Use inclusive language * Update scripts/validate_language.sh Co-authored-by: Yim Lee <[email protected]> Co-authored-by: Yim Lee <[email protected]>
1 parent 73f2b52 commit cc3033f

File tree

5 files changed

+38
-6
lines changed

5 files changed

+38
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,12 +601,12 @@ print(context.baggage.traceID ?? "new trace id")
601601

602602
## Contributing
603603

604-
Please make sure to run the `./scripts/sanity.sh` script when contributing, it checks formatting and similar things.
604+
Please make sure to run the `./scripts/soundness.sh` script when contributing, it checks formatting and similar things.
605605

606606
You can ensure it always is run and passes before you push by installing a pre-push hook with git:
607607

608608
``` sh
609-
echo './scripts/sanity.sh' > .git/hooks/pre-push
609+
echo './scripts/soundness.sh' > .git/hooks/pre-push
610610
```
611611

612612
### Formatting

docker/docker-compose.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ services:
2222
- CAP_NET_RAW
2323
- CAP_NET_BIND_SERVICE
2424

25-
sanity:
25+
soundness:
2626
<<: *common
27-
command: /bin/bash -xcl "./scripts/sanity.sh"
27+
command: /bin/bash -xcl "./scripts/soundness.sh"
2828

2929
docs:
3030
<<: *common

scripts/sanity.sh renamed to scripts/soundness.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ else
2828
fi
2929

3030
bash $here/validate_license_headers.sh
31+
bash $here/validate_language.sh
3132
bash $here/validate_format.sh
3233
bash $here/validate_naming.sh

scripts/validate_language.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
##===----------------------------------------------------------------------===##
3+
##
4+
## This source file is part of the Swift Distributed Tracing open source project
5+
##
6+
## Copyright (c) 2021 Apple Inc. and the Swift Distributed Tracing project authors
7+
## Licensed under Apache License v2.0
8+
##
9+
## See LICENSE.txt for license information
10+
##
11+
## SPDX-License-Identifier: Apache-2.0
12+
##
13+
##===----------------------------------------------------------------------===##
14+
15+
set -eu
16+
17+
printf "=> Checking for unacceptable language... "
18+
# This greps for unacceptable terminology. The square bracket[s] are so that
19+
# "git grep" doesn't find the lines that greps :).
20+
unacceptable_terms=(
21+
-e blacklis[t]
22+
-e whitelis[t]
23+
-e slav[e]
24+
-e sanit[y]
25+
)
26+
if git grep --color=never -i "${unacceptable_terms[@]}" > /dev/null; then
27+
printf "\033[0;31mUnacceptable language found.\033[0m\n"
28+
git grep -i "${unacceptable_terms[@]}"
29+
exit 1
30+
fi
31+
printf "\033[0;32mokay.\033[0m\n"

scripts/validate_license_headers.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
3131

3232
function replace_acceptable_years() {
3333
# this needs to replace all acceptable forms with 'YEARS'
34-
sed -e 's/2019-2020/YEARS/' -e 's/2020/YEARS/'
34+
sed -e 's/2019-2020/YEARS/' -e 's/2019-2021/YEARS/' -e 's/2020/YEARS/' -e 's/2021/YEARS/'
3535
}
3636

3737
printf "=> Checking license headers\n"
38-
tmp=$(mktemp /tmp/.swift-baggage-context-sanity_XXXXXX)
38+
tmp=$(mktemp /tmp/.swift-baggage-context-soundness_XXXXXX)
3939

4040
for language in swift-or-c bash dtrace; do
4141
printf " * $language... "

0 commit comments

Comments
 (0)