14 Commits

Author SHA1 Message Date
Pascal Hofmann
dd450a5352 chore: fix golangci-lint issues
Signed-off-by: Pascal Hofmann <mail@pascalhofmann.de>
2025-12-12 14:43:23 +01:00
James Geddes
bb098187e7 add support for .tofu files
Signed-off-by: James Geddes <j@jamesgeddes.pro>
2025-02-04 17:41:31 +00:00
Khosrow Moossavi
8f74fd4453 feat: ignore outputs, providers, resources with comments
Prepend any type of resource, including `resource`, `data`, `module`,
`variable`, and `output` with a comment including "terraform-docs-ignore"
to exclude it from the generated output.

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2024-05-30 12:33:14 -04:00
Christian Kampka
943489ca41 Ignore inputs with terraform-docs-ignore comment 2024-05-27 15:47:00 -04:00
Khosrow Moossavi
80c406f95d Merge pull request #749 from goruha/fix-outputs-values
Fix output values with null
2024-05-27 15:20:35 -04:00
Brittan DeYoung
fa916db457 testdata: Amend full-example/main.tf, add local value with provider function to verify terraform-docs can properly parse
Signed-off-by: Brittan DeYoung <32572259+brittandeyoung@users.noreply.github.com>
2024-05-17 10:01:04 -04:00
Igor Rodionov
656f6a64d5 Fix output values with null
Signed-off-by: Igor Rodionov <goruha@gmail.com>
2024-03-25 12:05:56 +01:00
Khosrow Moossavi
a321c282f2 Bump golang to 1.22.1
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2024-03-22 11:38:24 -04:00
Khosrow Moossavi
5cfb2f2615 Bump golangci-lint to 1.55.2 and fix issues
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2023-12-19 12:51:04 -05:00
Khosrow Moossavi
e72f215e3e Always convert CRLF to LF for output description
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2022-01-07 19:09:55 -05:00
Khosrow Moossavi
4a9ffe7c33 Move plugin-sdk to in-tree in core repository
Moving terraform-docs/plugin-sdk standalone module to in-tree, because
maintaining both of them, specifically if anything needs to be added to
Config, or terraform will required dual effort on both repository. As
such now everything is consolidated under one repository. Example usage
for plugin developer after this move is as follow:

```go
package main

import (
	_ "embed" //nolint

	"github.com/terraform-docs/terraform-docs/plugin"
	"github.com/terraform-docs/terraform-docs/print"
	"github.com/terraform-docs/terraform-docs/template"
	"github.com/terraform-docs/terraform-docs/terraform"
)

func main() {
	plugin.Serve(&plugin.ServeOpts{
		Name:    "template",
		Version: "0.1.0",
		Printer: printer,
	})
}

//go:embed sections.tmpl
var tplCustom []byte

// Print the custom format template. You have all the flexibility to generate
// the output however you choose to.
func printer(config *print.Config, module *terraform.Module) (string, error) {
	tpl := template.New(config,
		&template.Item{Name: "custom", Text: string(tplCustom)},
	)

	rendered, err := tpl.Render("custom", module)
	if err != nil {
		return "", err
	}

	return rendered, nil
}
```

Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-10-05 18:54:49 -04:00
Khosrow Moossavi
f3c92384a1 Extract leading comments for resources and modules
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-09-29 13:55:50 -04:00
Khosrow Moossavi
bb109711a1 Deprecate Settings and Options in favor of Config
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-09-28 15:47:27 -04:00
Khosrow Moossavi
ca8f8333d4 Move template package from internal to public
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-09-28 14:18:05 -04:00