Add script to check for illegal terms

pull/25414/head
Yash Tibrewal 4 years ago
parent 7c8defd5c9
commit 41df38bff8
  1. 4
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  2. 2
      src/core/lib/iomgr/resource_quota.cc
  3. 33
      tools/run_tests/sanity/check_illegal_terms.sh
  4. 1
      tools/run_tests/sanity/sanity_tests.yaml

@ -2097,7 +2097,7 @@ static void add_error(grpc_error* error, grpc_error** refs, size_t* nrefs) {
}
static grpc_error* removal_error(grpc_error* extra_error, grpc_chttp2_stream* s,
const char* master_error_msg) {
const char* main_error_msg) {
grpc_error* refs[3];
size_t nrefs = 0;
add_error(s->read_closed_error, refs, &nrefs);
@ -2105,7 +2105,7 @@ static grpc_error* removal_error(grpc_error* extra_error, grpc_chttp2_stream* s,
add_error(extra_error, refs, &nrefs);
grpc_error* error = GRPC_ERROR_NONE;
if (nrefs > 0) {
error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(master_error_msg,
error = GRPC_ERROR_CREATE_REFERENCING_FROM_STATIC_STRING(main_error_msg,
refs, nrefs);
}
GRPC_ERROR_UNREF(extra_error);

@ -132,7 +132,7 @@ struct grpc_resource_quota {
scaled to the range [0..RESOURCE_USAGE_ESTIMATION_MAX] */
gpr_atm memory_usage_estimation;
/* Master combiner lock: all activity on a quota executes under this combiner
/* Main combiner lock: all activity on a quota executes under this combiner
* (so no mutex is needed for this data structure) */
grpc_core::Combiner* combiner;
/* Size of the resource quota */

@ -0,0 +1,33 @@
#!/bin/sh
# Copyright 2021 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
set -e
cd "$(dirname "$0")/../../.."
#
# Disallow the usage of certain terms.
#
grep -PIirn \
'((\b|_)(black[\ -]?hat|black[\ -]?list|black[\ -]?listed|black[\ -]?listing|dummy|grand[\ -]?father\ clause|grand[\ -]?fathered|hang|hung|man[\ -]?power|man[\ -]?hours|master(?!/)|slave|white[\ -]?hat|white[\ -]?list|white[\ -]?listed|white[\ -]?listing)(\b|_))' \
examples \
include \
src/abseil-cpp \
src/compiler \
src/core \
src/cpp \
test | \
diff - /dev/null

@ -4,6 +4,7 @@
- script: tools/run_tests/sanity/check_buildifier.sh
- script: tools/run_tests/sanity/check_cache_mk.sh
- script: tools/run_tests/sanity/check_deprecated_grpc++.py
- script: tools/run_tests/sanity/check_illegal_terms.sh
- script: tools/run_tests/sanity/check_owners.sh
- script: tools/run_tests/sanity/check_port_platform.py
- script: tools/run_tests/sanity/check_qps_scenario_changes.py

Loading…
Cancel
Save