Skip to content

Commit 19e0ab6

Browse files
authored
use welcoming language (#79)
1 parent a7356e1 commit 19e0ab6

File tree

3 files changed

+26
-10
lines changed

3 files changed

+26
-10
lines changed

CONTRIBUTING.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -68,30 +68,30 @@ We require that your commit messages match our template. The easiest way to do t
6868
SwiftServiceLifecycle uses XCTest to run tests on both macOS and Linux. While the macOS version of XCTest is able to use the Objective-C runtime to discover tests at execution time, the Linux version is not.
6969
For this reason, whenever you add new tests **you have to run a script** that generates the hooks needed to run those tests on Linux, or our CI will complain that the tests are not all present on Linux. To do this, merely execute `ruby ./scripts/generate_linux_tests.rb` at the root of the package and check the changes it made.
7070

71-
### Run `./scripts/sanity.sh`
71+
### Run `./scripts/soundness.sh`
7272

73-
The scripts directory contains a [sanity.sh script](scripts/sanity.sh)
73+
The scripts directory contains a [soundness.sh script](scripts/soundness.sh)
7474
that enforces additional checks, like license headers and formatting style.
75-
Please make sure to `./scripts/sanity.sh` before pushing a change upstream, otherwise it is likely the PR validation will fail
75+
Please make sure to `./scripts/soundness.sh` before pushing a change upstream, otherwise it is likely the PR validation will fail
7676
on minor changes such as a missing `self.` or similar formatting issues.
7777

7878
> The script also executes the above mentioned `generate_linux_tests.rb`.
7979
8080
For frequent contributors, we recommend adding the script as a [git pre-push hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks), which you can do via executing the following command
81-
in the project root directory:
81+
in the project root directory:
8282

8383
```bash
8484
cat << EOF > .git/hooks/pre-push
8585
#!/bin/bash
8686
87-
if [[ -f "scripts/sanity.sh" ]]; then
88-
scripts/sanity.sh
87+
if [[ -f "scripts/soundness.sh" ]]; then
88+
scripts/soundness.sh
8989
fi
9090
EOF
9191
```
9292
Which makes the script execute, and only allow the `git push` to complete if the check has passed.
9393

94-
In the case of formatting issues, you can then `git add` the formatting changes, and attempt the push again.
94+
In the case of formatting issues, you can then `git add` the formatting changes, and attempt the push again.
9595

9696
## How to contribute your work
9797

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 -cl "./scripts/sanity.sh"
27+
command: /bin/bash -cl "./scripts/soundness.sh"
2828

2929
test:
3030
<<: *common

scripts/sanity.sh scripts/soundness.sh

+17-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,22 @@ function replace_acceptable_years() {
2222
sed -e 's/2017-2018/YEARS/' -e 's/2019-2020/YEARS/' -e 's/2019/YEARS/' -e 's/2020/YEARS/'
2323
}
2424

25+
printf "=> Checking for unacceptable language... "
26+
# This greps for unacceptable terminology. The square bracket[s] are so that
27+
# "git grep" doesn't find the lines that greps :).
28+
unacceptable_terms=(
29+
-e blacklis[t]
30+
-e whitelis[t]
31+
-e slav[e]
32+
-e sanit[y]
33+
)
34+
if git grep --color=never -i "${unacceptable_terms[@]}" > /dev/null; then
35+
printf "\033[0;31mUnacceptable language found.\033[0m\n"
36+
git grep -i "${unacceptable_terms[@]}"
37+
exit 1
38+
fi
39+
printf "\033[0;32mokay.\033[0m\n"
40+
2541
printf "=> Checking linux tests... "
2642
FIRST_OUT="$(git status --porcelain)"
2743
ruby "$here/../scripts/generate_linux_tests.rb" > /dev/null
@@ -47,7 +63,7 @@ else
4763
fi
4864

4965
printf "=> Checking license headers\n"
50-
tmp=$(mktemp /tmp/.swift-aws-lambda-sanity_XXXXXX)
66+
tmp=$(mktemp /tmp/.service-lifecycle-soundness_XXXXXX)
5167

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

0 commit comments

Comments
 (0)