From 459e52cb9a3f2e24d165ad59e0fad7d5cbcd5714 Mon Sep 17 00:00:00 2001 From: Joao Grassi Date: Wed, 13 Sep 2023 10:07:33 +0200 Subject: [PATCH 1/3] Update code format instructions after #29397 Signed-off-by: Joao Grassi --- envoy/stats/primitive_stats_macros.h | 4 ++-- envoy/stats/stats_macros.h | 4 ++-- support/README.md | 8 ++++---- tools/code_format/check_format.py | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/envoy/stats/primitive_stats_macros.h b/envoy/stats/primitive_stats_macros.h index a3b2713bad072..e27ab61247475 100644 --- a/envoy/stats/primitive_stats_macros.h +++ b/envoy/stats/primitive_stats_macros.h @@ -17,8 +17,8 @@ namespace Envoy { * * By convention, starting with #7083, we sort the lines of this macro block, so * all the counters are grouped together, then all the gauges, etc. We do not - * use clang-format-on/off etc. "./tools/code_format/check_format.py fix" will take care of - * lining up the backslashes. + * use clang-format-on/off etc. "bazel run //tools/code_format:check_format -- fix" will take + * care of lining up the backslashes. * * Now actually put these stats somewhere, usually as a member of a struct: * struct MyCoolStats { diff --git a/envoy/stats/stats_macros.h b/envoy/stats/stats_macros.h index 47caffb36d951..123bb7983624e 100644 --- a/envoy/stats/stats_macros.h +++ b/envoy/stats/stats_macros.h @@ -25,8 +25,8 @@ namespace Envoy { * * By convention, starting with #7083, we sort the lines of this macro block, so * all the counters are grouped together, then all the gauges, etc. We do not - * use clang-format-on/off etc. "./tools/code_format/check_format.py fix" will take care of - * lining up the backslashes. + * use clang-format-on/off etc. "bazel run //tools/code_format:check_format -- fix" will take + * care of lining up the backslashes. * * Now actually put these stats somewhere, usually as a member of a struct: * struct MyCoolStats { diff --git a/support/README.md b/support/README.md index 69d5c93f634fe..bdf6f538d79b3 100644 --- a/support/README.md +++ b/support/README.md @@ -55,19 +55,19 @@ affected files manually or run the provided formatting script. To run the format fix script directly: -``` -./tools/code_format/check_format.py fix && ./tools/code_format/format_python_tools.sh fix +```shell +bazel run //tools/code_format:check_format -- fix && ./tools/code_format/format_python_tools.sh fix ``` To run the format fix script under Docker: -``` +```shell ./ci/run_envoy_docker.sh './ci/do_ci.sh format' ``` To run clang-tidy under Docker, run the following (this creates a full compilation db and takes a long time): -``` +```shell ./ci/run_envoy_docker.sh ci/do_ci.sh bazel.clang_tidy ``` diff --git a/tools/code_format/check_format.py b/tools/code_format/check_format.py index 7add4a3922170..74f2bcf3906d3 100755 --- a/tools/code_format/check_format.py +++ b/tools/code_format/check_format.py @@ -1048,7 +1048,7 @@ def run_checks(self): if self.check_error_messages(): if self.args.operation_type == "check": - print("ERROR: check format failed. run '//tools/code_format:check_format -- fix'") + print("ERROR: check format failed. run 'bazel run //tools/code_format:check_format -- fix'") else: print("ERROR: check format failed. diff has been applied'") sys.exit(1) From aaea4357c36228f5860971938ccf8d243e422d7e Mon Sep 17 00:00:00 2001 From: Joao Grassi Date: Wed, 13 Sep 2023 10:46:22 +0200 Subject: [PATCH 2/3] Fix format issues Signed-off-by: Joao Grassi --- tools/code_format/check_format.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/code_format/check_format.py b/tools/code_format/check_format.py index 74f2bcf3906d3..e01821e685105 100755 --- a/tools/code_format/check_format.py +++ b/tools/code_format/check_format.py @@ -1048,7 +1048,9 @@ def run_checks(self): if self.check_error_messages(): if self.args.operation_type == "check": - print("ERROR: check format failed. run 'bazel run //tools/code_format:check_format -- fix'") + print( + "ERROR: check format failed. run 'bazel run //tools/code_format:check_format -- fix'" + ) else: print("ERROR: check format failed. diff has been applied'") sys.exit(1) From a4588f3dd3c2bcdf5d6970974335563fdb816a90 Mon Sep 17 00:00:00 2001 From: Joao Grassi Date: Wed, 13 Sep 2023 10:48:21 +0200 Subject: [PATCH 3/3] Use consistent markdown lang in snippet Signed-off-by: Joao Grassi --- support/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/support/README.md b/support/README.md index bdf6f538d79b3..a9ee34d17c84b 100644 --- a/support/README.md +++ b/support/README.md @@ -55,19 +55,19 @@ affected files manually or run the provided formatting script. To run the format fix script directly: -```shell +```console bazel run //tools/code_format:check_format -- fix && ./tools/code_format/format_python_tools.sh fix ``` To run the format fix script under Docker: -```shell +```console ./ci/run_envoy_docker.sh './ci/do_ci.sh format' ``` To run clang-tidy under Docker, run the following (this creates a full compilation db and takes a long time): -```shell +```console ./ci/run_envoy_docker.sh ci/do_ci.sh bazel.clang_tidy ```