Help us shape the future of Go! Take the 2026 Go Developer Survey

contents

package
v0.26.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 11, 2026 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package contents validates the body of individual Terraform Provider documentation files: headings, sections, schema attribute lists, and related content rules.

Deprecated: tfproviderdocs is no longer maintained. All functionality has been superseded by github.com/YakDriver/swissshepherd. Please migrate: https://github.com/YakDriver/swissshepherd

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgumentsSection

type ArgumentsSection SchemaAttributeSection

ArgumentsSection represents a resource arguments section.

type AttributesSection

type AttributesSection SchemaAttributeSection

AttributesSection represents a resource attributes section.

type CheckArgumentsSectionOptions

type CheckArgumentsSectionOptions struct {
	EnhancedRegionChecks  bool
	RegionAware           bool // The resource is Region-aware and has a top-level region argument.
	RequireSchemaOrdering bool
	ExpectedBylineTexts   []string
	AllowedHeadingTexts   []string
	AllowMissingByline    bool
}

type CheckAttributesSectionOptions

type CheckAttributesSectionOptions struct {
	RequireSchemaOrdering bool
	RequireSection        SectionRequirement
}

type CheckExamplesSectionOptions

type CheckExamplesSectionOptions struct {
	ExpectedCodeBlockLanguage string
}

type CheckImportSectionOptions added in v0.23.0

type CheckImportSectionOptions struct {
	RequireSection SectionRequirement
}

type CheckOptions

type CheckOptions struct {
	ArgumentsSection  *CheckArgumentsSectionOptions
	AttributesSection *CheckAttributesSectionOptions
	ExamplesSection   *CheckExamplesSectionOptions
	TimeoutsSection   *CheckTimeoutsSectionOptions
	ImportSection     *CheckImportSectionOptions
	TitleSection      *CheckTitleSectionOptions
	SignatureSection  *CheckSignatureSectionOptions

	DisallowAttributesSection          bool
	AttributesSectionDisallowedMessage string
	DisallowImportSection              bool
	ImportSectionDisallowedMessage     string
}

type CheckSignatureSectionOptions added in v0.23.0

type CheckSignatureSectionOptions struct {
	RequireSection      SectionRequirement
	AllowedHeadingTexts []string
	RequireCodeBlock    bool
}

type CheckTimeoutsSectionOptions added in v0.23.0

type CheckTimeoutsSectionOptions struct {
	RequireSection SectionRequirement
}

type CheckTitleSectionOptions added in v0.23.0

type CheckTitleSectionOptions struct {
	AllowedPrefixes []string
}

type Document

type Document struct {
	CheckOptions *CheckOptions
	ProviderName string
	ResourceName string
	Sections     *Sections
	// contains filtered or unexported fields
}

func NewDocument

func NewDocument(path string, providerName string) *Document

func (*Document) Check

func (d *Document) Check(opts *CheckOptions) error

func (*Document) Parse

func (d *Document) Parse() error

type ExampleSection

type ExampleSection struct {
	// Children contains further nested sections below this section
	Children []*ExampleSection

	FencedCodeBlocks []*ast.FencedCodeBlock
	Heading          *ast.Heading
	Paragraphs       []*ast.Paragraph
}

ExampleSection represents a resource example code section.

type ImportSection

type ImportSection struct {
	FencedCodeBlocks []*ast.FencedCodeBlock
	Heading          *ast.Heading
	Paragraphs       []*ast.Paragraph
}

ImportSection represents a resource import section.

type SchemaAttributeList

type SchemaAttributeList struct {
	Items []*SchemaAttributeListItem
}

SchemaAttributeList represents a schema attribute list

This may represent root or nested lists of arguments or attributes

type SchemaAttributeListItem

type SchemaAttributeListItem struct {
	Description string
	ForceNew    bool
	Name        string
	Optional    bool
	Required    bool
	Type        string
}

SchemaAttributeListItem represents a schema attribute list item

This may represent root or nested lists of arguments or attributes

type SchemaAttributeListItemByName

type SchemaAttributeListItemByName []*SchemaAttributeListItem

func (SchemaAttributeListItemByName) Len

func (SchemaAttributeListItemByName) Less

func (item SchemaAttributeListItemByName) Less(i, j int) bool

func (SchemaAttributeListItemByName) Swap

func (item SchemaAttributeListItemByName) Swap(i, j int)

type SchemaAttributeSection

type SchemaAttributeSection struct {
	// Children contains further nested sections below this section
	Children []*SchemaAttributeSection

	// FencedCodeBlocks contains any found code blocks
	FencedCodeBlocks []*ast.FencedCodeBlock

	// Heading is the root/nested heading for the section
	Heading *ast.Heading

	// Lists is the groupings of per-attribute documentation
	//
	// Some sections may be split these based on Optional versus Required
	Lists []*ast.List

	// SchemaAttributeLists is the groupings of per-attribute documentation
	//
	// Some sections may be split these based on Optional versus Required
	SchemaAttributeLists []*SchemaAttributeList

	// Paragraphs is typically the byline(s) of per-attribute documentation
	//
	// Some sections may be split these based on Optional versus Required
	Paragraphs []*ast.Paragraph
}

SchemaAttributeSection represents a schema attribute section

This may represent root or nested lists of arguments or attributes

type SectionRequirement added in v0.23.0

type SectionRequirement int
const (
	Optional SectionRequirement = iota
	Required
	Forbidden
)

type Sections

type Sections struct {
	Attributes *AttributesSection
	Arguments  *ArgumentsSection
	Example    *ExampleSection
	Import     *ImportSection
	Timeouts   *TimeoutsSection
	Signature  *SignatureSection
	Title      *TitleSection
}

Sections represents all expected sections of a resource documentation page

type SignatureSection added in v0.23.0

type SignatureSection struct {
	FencedCodeBlocks []*ast.FencedCodeBlock
	Heading          *ast.Heading
	Paragraphs       []*ast.Paragraph
}

SignatureSection represents a function signature section.

type TimeoutsSection

type TimeoutsSection struct {
	FencedCodeBlocks []*ast.FencedCodeBlock
	Heading          *ast.Heading
	Lists            []*ast.List
	Paragraphs       []*ast.Paragraph
}

TimeoutsSection represents a resource timeouts section.

type TitleSection

type TitleSection struct {
	FencedCodeBlocks []*ast.FencedCodeBlock
	Heading          *ast.Heading
	Paragraphs       []*ast.Paragraph
}

TitleSection represents the top documentation section

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL