4 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
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
3467aa9790 Fix faulty license headers
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2021-10-06 16:05:58 -04: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