envoyproxy / nighthawk

L7 (HTTP/HTTPS/HTTP2/HTTP3) performance characterization tool
Apache License 2.0
361 stars 81 forks source link

Stop excluding /api/client/BUILD in check_format #165

Open oschaaf opened 5 years ago

oschaaf commented 5 years ago

We exclude api/client/BUILD in check_format.sh, because the build insists on adding

load("bazel:envoy_build_system.bzl", "envoy_package")

For this to work for Nighthawk, this should look like:

load("@envoy//bazel:envoy_build_system.bzl", "envoy_package")

So either having a way to pull that off, or a way to make a more narrow exclusion instead of excluding the whole file from check_format would be desirable.

oschaaf commented 5 years ago

Relevant code in Envoy's repo:

def FixPackageAndLicense(contents):
  # Ensure we have an envoy_package import load if this is a real Envoy package.
  if re.search(ENVOY_RULE_REGEX, contents):
    contents = RunBuildozer([
        ('new_load //bazel:envoy_build_system.bzl envoy_package', '__pkg__'),
    ], contents)

I think that if we could somehow wire through and convey that we need @envoy// here, we could stop exclusions again and benefit from the build fixer.