|
3 | 3 | ##
|
4 | 4 | ## This source file is part of the SwiftStatsdClient open source project
|
5 | 5 | ##
|
6 |
| -## Copyright (c) 2019 the SwiftStatsdClient project authors |
| 6 | +## Copyright (c) 2019-2022 the SwiftStatsdClient project authors |
7 | 7 | ## Licensed under Apache License v2.0
|
8 | 8 | ##
|
9 | 9 | ## See LICENSE.txt for license information
|
|
14 | 14 | ##===----------------------------------------------------------------------===##
|
15 | 15 |
|
16 | 16 | set -eu
|
| 17 | + |
17 | 18 | here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
18 | 19 |
|
| 20 | +function replace_acceptable_years() { |
| 21 | + # this needs to replace all acceptable forms with 'YEARS' |
| 22 | + sed -e 's/20[12][901]-202[012]/YEARS/' -e 's/2019/YEARS/' -e 's/202[012]/YEARS/' |
| 23 | +} |
| 24 | + |
19 | 25 | printf "=> Checking for unacceptable language... "
|
20 | 26 | # This greps for unacceptable terminology. The square bracket[s] are so that
|
21 | 27 | # "git grep" doesn't find the lines that greps :).
|
@@ -67,14 +73,14 @@ for language in swift-or-c bash dtrace; do
|
67 | 73 | matching_files=( -name '*' )
|
68 | 74 | case "$language" in
|
69 | 75 | swift-or-c)
|
70 |
| - exceptions=( -name c_nio_http_parser.c -o -name c_nio_http_parser.h -o -name cpp_magic.h -o -name Package.swift -o -name CNIOSHA1.h -o -name c_nio_sha1.c -o -name ifaddrs-android.c -o -name ifaddrs-android.h) |
| 76 | + exceptions=( -name c_nio_http_parser.c -o -name c_nio_http_parser.h -o -name cpp_magic.h -o -name Package.swift -o -name [email protected] -o -name CNIOSHA1.h -o -name c_nio_sha1.c -o -name ifaddrs-android.c -o -name ifaddrs-android.h) |
71 | 77 | matching_files=( -name '*.swift' -o -name '*.c' -o -name '*.h' )
|
72 | 78 | cat > "$tmp" <<"EOF"
|
73 | 79 | //===----------------------------------------------------------------------===//
|
74 | 80 | //
|
75 | 81 | // This source file is part of the SwiftStatsdClient open source project
|
76 | 82 | //
|
77 |
| -// Copyright (c) 2019 the SwiftStatsdClient project authors |
| 83 | +// Copyright (c) YEARS the SwiftStatsdClient project authors |
78 | 84 | // Licensed under Apache License v2.0
|
79 | 85 | //
|
80 | 86 | // See LICENSE.txt for license information
|
|
93 | 99 | ##
|
94 | 100 | ## This source file is part of the SwiftStatsdClient open source project
|
95 | 101 | ##
|
96 |
| -## Copyright (c) 2019 the SwiftStatsdClient project authors |
| 102 | +## Copyright (c) YEARS the SwiftStatsdClient project authors |
97 | 103 | ## Licensed under Apache License v2.0
|
98 | 104 | ##
|
99 | 105 | ## See LICENSE.txt for license information
|
|
112 | 118 | *
|
113 | 119 | * This source file is part of the SwiftStatsdClient open source project
|
114 | 120 | *
|
115 |
| - * Copyright (c) 2019 the SwiftStatsdClient project authors |
| 121 | + * Copyright (c) YEARS the SwiftStatsdClient project authors |
116 | 122 | * Licensed under Apache License v2.0
|
117 | 123 | *
|
118 | 124 | * See LICENSE.txt for license information
|
|
137 | 143 | \( \! -path './.build/*' -a \
|
138 | 144 | \( "${matching_files[@]}" \) -a \
|
139 | 145 | \( \! \( "${exceptions[@]}" \) \) \) | while read line; do
|
140 |
| - if [[ "$(cat "$line" | head -n $expected_lines | shasum)" != "$expected_sha" ]]; then |
| 146 | + if [[ "$(cat "$line" | replace_acceptable_years | head -n $expected_lines | shasum)" != "$expected_sha" ]]; then |
141 | 147 | printf "\033[0;31mmissing headers in file '$line'!\033[0m\n"
|
142 | 148 | diff -u <(cat "$line" | head -n $expected_lines) "$tmp"
|
143 | 149 | exit 1
|
|
0 commit comments