Skip to content

Commit f976533

Browse files
ktosoyim-lee
andauthored
use inclusive language (#10)
* depend on 0.1.0 baggage core * use inslucive language * Update scripts/validate_language.sh Co-authored-by: Yim Lee <yim_lee@apple.com> Co-authored-by: Yim Lee <yim_lee@apple.com>
1 parent e1bff92 commit f976533

6 files changed

+39
-7
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ Please refer to in-depth discussion and documentation in the [Swift Distributed
3232

3333
## Contributing
3434

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

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

3939
```
40-
echo './scripts/sanity.sh' > .git/hooks/pre-push
40+
echo './scripts/soundness.sh' > .git/hooks/pre-push
4141
```

Sources/Baggage/LoggingContext.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
///
2626
/// ### Implementation notes
2727
/// Conforming types MUST exhibit Value Semantics (i.e. be a pure `struct`, or implement the Copy-on-Write pattern),
28-
/// in order to implement the `set` requirements of the baggage and logger effectively, and also for their user's sanity,
28+
/// in order to implement the `set` requirements of the baggage and logger effectively, and also for ease of understanding,
2929
/// as a reference semantics context type can be very confusing to use when shared between multiple threads, as often is the case in server side environments.
3030
///
3131
/// It is STRONGLY encouraged to use the `DefaultLoggingContext` as inspiration for a correct implementation of a `LoggingContext`,

docker/docker-compose.yaml

+2-2
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 scripts/soundness.sh

+1
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

+31
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 Baggage open source project
5+
##
6+
## Copyright (c) 2021 Apple Inc. and the Swift Distributed Tracing Baggage 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

+2-2
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)