From 051be1f1ded61d5258a3e078316873514a22121d Mon Sep 17 00:00:00 2001 From: Khosrow Moossavi Date: Thu, 30 May 2024 18:37:23 -0400 Subject: [PATCH] Make main module doc optional when in recursive generation Signed-off-by: Khosrow Moossavi --- examples/.terraform-docs.yml | 1 + internal/cli/run.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/.terraform-docs.yml b/examples/.terraform-docs.yml index 80d8c6c..7d69070 100644 --- a/examples/.terraform-docs.yml +++ b/examples/.terraform-docs.yml @@ -14,6 +14,7 @@ footer-from: footer.md # recursive: # enabled: false # path: modules +# include-main: false # see: https://terraform-docs.io/user-guide/configuration/sections sections: diff --git a/internal/cli/run.go b/internal/cli/run.go index b241663..05678e8 100644 --- a/internal/cli/run.go +++ b/internal/cli/run.go @@ -97,7 +97,7 @@ type module struct { func (r *Runtime) RunEFunc(cmd *cobra.Command, args []string) error { //nolint:gocyclo modules := []module{} - if r.config.Recursive.IncludeMain { + if !r.config.Recursive.Enabled || r.config.Recursive.IncludeMain { modules = append(modules, module{r.rootDir, r.config}) }