File tree Expand file tree Collapse file tree 5 files changed +38
-6
lines changed Expand file tree Collapse file tree 5 files changed +38
-6
lines changed Original file line number Diff line number Diff 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
606606You 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 2828fi
2929
3030bash $here /validate_license_headers.sh
31+ bash $here /validate_language.sh
3132bash $here /validate_format.sh
3233bash $here /validate_naming.sh
Original file line number Diff line number Diff line change 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"
Original file line number Diff line number Diff line change @@ -31,11 +31,11 @@ here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
3131
3232function 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
3737printf " => Checking license headers\n"
38- tmp=$( mktemp /tmp/.swift-baggage-context-sanity_XXXXXX )
38+ tmp=$( mktemp /tmp/.swift-baggage-context-soundness_XXXXXX )
3939
4040for language in swift-or-c bash dtrace; do
4141 printf " * $language ... "
You can’t perform that action at this time.
0 commit comments