From 197b8c58d09e727cb9d05d256657243cfcc3c730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Barzowski?= Date: Wed, 14 Aug 2019 19:38:57 +0200 Subject: [PATCH] Prevent autogenerated header in BUILD.bazel Before this change updating BUILD.bazel file with Gazelle would add `c-bindings/libgojsonnet.h` to `srcs/`. It was prevented manually, but someone is going to let it slip in at some point, so it's better to just not include it there in the first place. --- c-bindings/BUILD.bazel | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/c-bindings/BUILD.bazel b/c-bindings/BUILD.bazel index ee8006b..9edd4bd 100644 --- a/c-bindings/BUILD.bazel +++ b/c-bindings/BUILD.bazel @@ -1,5 +1,14 @@ load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library") +# If you run `go build` a header "libgojsonnet.h" will be autogenerated in +# this directory. Then it can be picked up by Gazelle and added to `srcs` here. +# When building with Bazel the file gets created elsewhere in Bazel's +# sandbox tree, so when using Bazel exclusively it won't cause any trouble. +# However, sooner or later someone is going to run Gazelle after using `go build` +# and then the file may slip in, so it's better to just exclude it explicitly, +# with the directive below: +# gazelle:exclude ./libgojsonnet.h + go_library( name = "go_default_library", srcs = [