From 099882ebbdce56398c5a0a4aefbc08231a8f0bdd Mon Sep 17 00:00:00 2001 From: Ricky Stewart Date: Wed, 20 Jul 2022 19:31:46 +0000 Subject: [PATCH] docs: fail to build `bnf` if not all files are declared in `OUTS` Release note: None --- docs/generated/sql/bnf/BUILD.bazel | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/generated/sql/bnf/BUILD.bazel b/docs/generated/sql/bnf/BUILD.bazel index 1ce3b322fd89..b18205ac6df7 100644 --- a/docs/generated/sql/bnf/BUILD.bazel +++ b/docs/generated/sql/bnf/BUILD.bazel @@ -255,6 +255,13 @@ genrule( outs = [file + ".bnf" for file in FILES], cmd = """ $(location //pkg/cmd/docgen) grammar bnf $(RULEDIR) --quiet --addr $(location //pkg/sql/parser:sql.y) + for FILE in $$(ls $(RULEDIR)) + do + if [[ "$(OUTS)" != *"$$FILE"* ]]; then + echo "$$FILE is not a generated file; please add $${FILE%.bnf} to the list of FILES in docs/generated/sql/bnf/BUILD.bazel" + exit 1 + fi + done """, exec_tools = ["//pkg/cmd/docgen"], visibility = [