envoyproxy / envoyproxy/nighthawk

Run envoy code formatter on proto files

Open
#917 0 comments 0 reactions 0 assignees View on GitHub
enhancement tech-debt
Dominant language
C++
Stars
414
Forks
95
Avg merge
2d 9h
Merged PRs (30d)
11

Description

When we run fix_format script, there is currently a warning that appears:
```
Please note: `tools/code_format/check_format.py` no longer checks API `.proto` files, please use `tools/proto_format/proto_format.sh` if you are making changes to the API files
```

We should probably also run this as part of our formatting. However, I believe it requires an upstream change to allow us to access it in bazel. When I tried to run it manually, got:
```
nbperry@nbperry:~/git/nbperry-nighthawk$ bazel run @envoy//tools/proto_format:proto_format.sh
WARNING: The following configs were expanded more than once: [rbe-toolchain-clang-libc++, rbe-toolchain]. For repeatable flags, repeats are counted twice and may lead to unexpected behavior.
INFO: Invocation ID: 26035fbf-f9f6-47c0-806b-e611de42ac32
ERROR: Skipping '@envoy//tools/proto_format:proto_format.sh': no such target '@envoy//tools/proto_format:proto_format.sh': target 'proto_format.sh' not declared in package 'tools/proto_format'; however, a source file of this name exists. (Perhaps add 'exports_files(["proto_format.sh"])' to tools/proto_format/BUILD?) defined by /usr/local/google/home/nbperry/.cache/bazel/_bazel_nbperry/2b135b66df44e56e2b3c6661f277b0d6/external/envoy/tools/proto_format/BUILD
WARNING: Target pattern parsing failed.
ERROR: no such target '@envoy//tools/proto_format:proto_format.sh': target 'proto_format.sh' not declared in package 'tools/proto_format'; however, a source file of this name exists. (Perhaps add 'exports_files(["proto_format.sh"])' to tools/proto_format/BUILD?) defined by /usr/local/google/home/nbperry/.cache/bazel/_bazel_nbperry/2b135b66df44e56e2b3c6661f277b0d6/external/envoy/tools/proto_format/BUILD
INFO: Elapsed time: 0.602s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded)
FAILED: Build did NOT complete successfully (1 packages loaded)
```

But it's possible that I made that command wrong, and that an upstream envoy change is not required.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.