Skip to content

Commit

Permalink
generate docs with tools package
Browse files Browse the repository at this point in the history
  • Loading branch information
anGie44 committed Dec 23, 2024
1 parent 026bcbf commit 2e5bede
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,8 @@ updates:
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"

2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- uses: hashicorp/setup-terraform@v3
with:
terraform_wrapper: false
- run: go generate ./...
- run: make generate
- name: git diff
run: |
git diff --compact-summary --exit-code || \
Expand Down
23 changes: 21 additions & 2 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
default: testacc
default: fmt lint install generate

build:
go build -v ./...

install:
go install -v ./...

lint:
golangci-lint run

generate:
cd tools; go generate ./...

fmt:
gofmt -s -w -e .

test:
go test -v -cover -timeout 120s -parallel=10 ./...

# Run acceptance tests
.PHONY: testacc
testacc:
TF_ACC=1 go test ./... -v $(TESTARGS) -timeout 120m

PHONY: fmt lint test testacc build install generate
10 changes: 0 additions & 10 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@ import (
"github.com/hashicorp/terraform-plugin-framework/providerserver"
)

// Run "go generate" to format example terraform files and generate the docs for the registry/website

// If you do not have terraform installed, you can remove the formatting command, but its suggested to
// ensure the documentation is formatted properly.
//go:generate terraform fmt -recursive ./examples/

// Run the docs generation tool, check its repository for more information on how it works and how docs
// can be customized.
//go:generate go run github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs

var (
// these will be set by the goreleaser configuration
// to appropriate values for the compiled binary.
Expand Down
2 changes: 1 addition & 1 deletion tools/tools.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

//go:build tools
//go:build generate

package tools

Expand Down

0 comments on commit 2e5bede

Please sign in to comment.