From ff258090208269b2e1f2346d05e33e72db9fb095 Mon Sep 17 00:00:00 2001 From: Ludovico Magnocavallo Date: Thu, 5 May 2022 14:43:38 +0200 Subject: [PATCH] Fix tfdoc parsing on newllines in outputs (#649) * fix * use the right (ugly) Python formatter * boilerplate on new file * and do the actual tfdoc run on the original outputs file --- modules/net-vpc-firewall/README.md | 3 +-- tests/fast/stages/s03_data_platform/__init__.py | 13 +++++++++++++ tools/tfdoc.py | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 tests/fast/stages/s03_data_platform/__init__.py diff --git a/modules/net-vpc-firewall/README.md b/modules/net-vpc-firewall/README.md index 75f6d48c4..6a542e1e4 100644 --- a/modules/net-vpc-firewall/README.md +++ b/modules/net-vpc-firewall/README.md @@ -144,8 +144,7 @@ healthchecks: | name | description | sensitive | |---|---|:---:| -| [admin_ranges](outputs.tf#L17) | Admin ranges data. - value = { enabled = length(var.admin_ranges) > 0 ranges = join(",", var.admin_ranges) } | | +| [admin_ranges](outputs.tf#L17) | Admin ranges data. | | | [custom_egress_allow_rules](outputs.tf#L26) | Custom egress rules with allow blocks. | | | [custom_egress_deny_rules](outputs.tf#L34) | Custom egress rules with allow blocks. | | | [custom_ingress_allow_rules](outputs.tf#L42) | Custom ingress rules with allow blocks. | | diff --git a/tests/fast/stages/s03_data_platform/__init__.py b/tests/fast/stages/s03_data_platform/__init__.py new file mode 100644 index 000000000..6d6d1266c --- /dev/null +++ b/tests/fast/stages/s03_data_platform/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/tools/tfdoc.py b/tools/tfdoc.py index b4d36fb55..d7771fb58 100755 --- a/tools/tfdoc.py +++ b/tools/tfdoc.py @@ -70,7 +70,7 @@ OUT_RE = re.compile(r'''(?smx) # output open (?:^\s*output\s*"([^"]+)"\s*\{\s*$) | # attribute - (?:^\s{2}([a-z]+)\s*=\s*"?(.*?)"?\s*$) | + (?:^\n?\s{2}([a-z]+)\s*=\s*"?(.*?)"?\s*$) | # output close (?:^\s?(\})\s*$) | # comment