From cc841881e3f383903db8503d2904fb6713d36086 Mon Sep 17 00:00:00 2001 From: Alyssa Wilk Date: Mon, 11 Oct 2021 09:54:24 -0400 Subject: [PATCH 1/3] WIP Signed-off-by: Alyssa Wilk --- tools/code_format/check_format.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/code_format/check_format.py b/tools/code_format/check_format.py index d01897fc338a0..a6f146b112fd9 100755 --- a/tools/code_format/check_format.py +++ b/tools/code_format/check_format.py @@ -266,7 +266,6 @@ UNSORTED_FLAGS = { "envoy.reloadable_features.activate_timers_next_event_loop", - "envoy.reloadable_features.check_ocsp_policy", "envoy.reloadable_features.grpc_json_transcoder_adhere_to_buffer_limits", "envoy.reloadable_features.upstream_http2_flood_checks", "envoy.reloadable_features.header_map_correctly_coalesce_cookies", From 1e53f5d2d83b7fb5b037d602ec21553b1e8fc2ac Mon Sep 17 00:00:00 2001 From: Alyssa Wilk Date: Mon, 11 Oct 2021 10:31:46 -0400 Subject: [PATCH 2/3] flags: trying again for alpha sorting Signed-off-by: Alyssa Wilk --- source/common/runtime/runtime_features.cc | 4 ++++ tools/code_format/check_format.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source/common/runtime/runtime_features.cc b/source/common/runtime/runtime_features.cc index dcbb89dec7326..bdd0119441984 100644 --- a/source/common/runtime/runtime_features.cc +++ b/source/common/runtime/runtime_features.cc @@ -51,6 +51,7 @@ uint64_t getInteger(absl::string_view feature, uint64_t default_value) { // If issues are found that require a runtime feature to be disabled, it should be reported // ASAP by filing a bug on github. Overriding non-buggy code is strongly discouraged to avoid the // problem of the bugs being found after the old code path has been removed. +// clang-format off constexpr const char* runtime_features[] = { // Enabled "envoy.reloadable_features.test_feature_true", @@ -97,10 +98,13 @@ constexpr const char* runtime_features[] = { "envoy.reloadable_features.wasm_cluster_name_envoy_grpc", "envoy.reloadable_features.upstream_http2_flood_checks", "envoy.restart_features.use_apple_api_for_dns_lookups", + // Misplaced flags: please do not add flags to this section. "envoy.reloadable_features.header_map_correctly_coalesce_cookies", "envoy.reloadable_features.sanitize_http_header_referer", "envoy.reloadable_features.skip_dispatching_frames_for_closed_connection", + // End misplaced flags: please do not add flags in this section. }; +// clang-format on // This is a section for officially sanctioned runtime features which are too // high risk to be enabled by default. Examples where we have opted to land diff --git a/tools/code_format/check_format.py b/tools/code_format/check_format.py index a6f146b112fd9..7a9db4a8467e5 100755 --- a/tools/code_format/check_format.py +++ b/tools/code_format/check_format.py @@ -530,7 +530,8 @@ def check_runtime_flags(self, file_path, error_messages): continue if "}" in line: break - + if "//" in line: + break match = FLAG_REGEX.match(line) if not match: error_messages.append("%s does not look like a reloadable flag" % line) From 9dc8cc918d3c707a15b6af99306c365918b99161 Mon Sep 17 00:00:00 2001 From: Alyssa Wilk Date: Tue, 12 Oct 2021 10:40:50 -0400 Subject: [PATCH 3/3] proposed fix Signed-off-by: Alyssa Wilk --- tools/code_format/check_format.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/code_format/check_format.py b/tools/code_format/check_format.py index 7a9db4a8467e5..99b23e5e6d7c2 100755 --- a/tools/code_format/check_format.py +++ b/tools/code_format/check_format.py @@ -531,7 +531,7 @@ def check_runtime_flags(self, file_path, error_messages): if "}" in line: break if "//" in line: - break + continue match = FLAG_REGEX.match(line) if not match: error_messages.append("%s does not look like a reloadable flag" % line)