Documentation ¶
Index ¶
- Constants
- Variables
- func FileIgnoreCheck(path string) bool
- func FilePathEndsWithExtensionFrom(path string, validExtensions []string) bool
- func FileSizeCheck(fullpath string) error
- func GetDirectories(basepath string) (map[string][]string, error)
- func InvalidDirectoriesCheck(directories map[string][]string) error
- func IsValidCdktfDirectory(directory string) bool
- func IsValidLegacyDirectory(directory string) bool
- func IsValidRegistryDirectory(directory string) bool
- func LegacyFileExtensionCheck(path string) error
- func MixedDirectoriesCheck(directories map[string][]string) error
- func RegistryFileExtensionCheck(path string) error
- func TrimFileExtension(path string) string
- type Check
- type CheckOptions
- type ContentsCheck
- type ContentsOptions
- type FileCheck
- type FileMismatchCheck
- type FileMismatchOptions
- type FileOptions
- type FrontMatterCheck
- type FrontMatterData
- type FrontMatterOptions
- type LegacyDataSourceFileCheck
- type LegacyDataSourceFileOptions
- type LegacyEphemeralFileCheck
- type LegacyEphemeralFileOptions
- type LegacyFunctionFileCheck
- type LegacyFunctionFileOptions
- type LegacyGuideFileCheck
- type LegacyGuideFileOptions
- type LegacyIndexFileCheck
- type LegacyIndexFileOptions
- type LegacyResourceFileCheck
- type LegacyResourceFileOptions
- type RegistryDataSourceFileCheck
- type RegistryDataSourceFileOptions
- type RegistryEphemeralFileCheck
- type RegistryEphemeralFileOptions
- type RegistryFunctionFileCheck
- type RegistryFunctionFileOptions
- type RegistryGuideFileCheck
- type RegistryGuideFileOptions
- type RegistryIndexFileCheck
- type RegistryIndexFileOptions
- type RegistryResourceFileCheck
- type RegistryResourceFileOptions
Constants ¶
View Source
const ( ResourceTypeDataSource = "data source" ResourceTypeEphemeral = "ephemeral" ResourceTypeFunction = "function" ResourceTypeResource = "resource" // Terraform Registry Storage Limits RegistryMaximumSizeOfFile = 500000 // 500KB )
View Source
const ( CdktfIndexDirectory = `cdktf` DocumentationGlobPattern = `{docs/index.md,docs/{,cdktf/}{data-sources,ephemeral-resources,guides,resources},website/docs}/**/*` LegacyIndexDirectory = `website/docs` LegacyDataSourcesDirectory = `d` LegacyEphemeralsDirectory = `ephemeral-resources` LegacyFunctionsDirectory = `functions` LegacyGuidesDirectory = `guides` LegacyResourcesDirectory = `r` RegistryIndexDirectory = `docs` RegistryDataSourcesDirectory = `data-sources` RegistryEphemeralsDirectory = `ephemeral-resources` RegistryFunctionsDirectory = `functions` RegistryGuidesDirectory = `guides` RegistryResourcesDirectory = `resources` )
View Source
const ( FileExtensionHtmlMarkdown = `.html.markdown` FileExtensionHtmlMd = `.html.md` FileExtensionMarkdown = `.markdown` FileExtensionMd = `.md` )
View Source
const (
FileIgnoreDSStore = `.DS_Store`
)
Variables ¶
View Source
var IgnoreFiles = []string{ FileIgnoreDSStore, }
View Source
var ValidCdktfLanguages = []string{
"csharp",
"go",
"java",
"python",
"typescript",
}
View Source
var ValidLegacyDirectories = []string{ LegacyIndexDirectory, LegacyIndexDirectory + "/" + LegacyDataSourcesDirectory, LegacyIndexDirectory + "/" + LegacyEphemeralsDirectory, LegacyIndexDirectory + "/" + LegacyFunctionsDirectory, LegacyIndexDirectory + "/" + LegacyGuidesDirectory, LegacyIndexDirectory + "/" + LegacyResourcesDirectory, }
View Source
var ValidLegacyFileExtensions = []string{ FileExtensionHtmlMarkdown, FileExtensionHtmlMd, FileExtensionMarkdown, FileExtensionMd, }
View Source
var ValidLegacySubdirectories = []string{ LegacyDataSourcesDirectory, LegacyEphemeralsDirectory, LegacyFunctionsDirectory, LegacyGuidesDirectory, LegacyResourcesDirectory, }
View Source
var ValidRegistryDirectories = []string{ RegistryIndexDirectory, RegistryIndexDirectory + "/" + RegistryDataSourcesDirectory, RegistryIndexDirectory + "/" + RegistryEphemeralsDirectory, RegistryIndexDirectory + "/" + RegistryFunctionsDirectory, RegistryIndexDirectory + "/" + RegistryGuidesDirectory, RegistryIndexDirectory + "/" + RegistryResourcesDirectory, }
View Source
var ValidRegistryFileExtensions = []string{ FileExtensionMd, }
View Source
var ValidRegistrySubdirectories = []string{ RegistryDataSourcesDirectory, RegistryEphemeralsDirectory, RegistryFunctionsDirectory, RegistryGuidesDirectory, RegistryResourcesDirectory, }
Functions ¶
func FileIgnoreCheck ¶ added in v0.16.7
FileIgnoreCheck checks if the file should be ignored.
func FileSizeCheck ¶
FileSizeCheck verifies that documentation file is below the Terraform Registry storage limit.
func InvalidDirectoriesCheck ¶
func IsValidCdktfDirectory ¶
func IsValidLegacyDirectory ¶
func MixedDirectoriesCheck ¶
func TrimFileExtension ¶
TrimFileExtension removes file extensions including those with multiple periods.
Types ¶
type Check ¶
type Check struct {
Options *CheckOptions
}
func NewCheck ¶
func NewCheck(opts *CheckOptions) *Check
type CheckOptions ¶
type CheckOptions struct { DataSourceFileMismatch *FileMismatchOptions EphemeralFileMismatch *FileMismatchOptions FunctionFileMismatch *FileMismatchOptions ResourceFileMismatch *FileMismatchOptions LegacyDataSourceFile *LegacyDataSourceFileOptions LegacyEphemeralFile *LegacyEphemeralFileOptions LegacyFunctionFile *LegacyFunctionFileOptions LegacyGuideFile *LegacyGuideFileOptions LegacyIndexFile *LegacyIndexFileOptions LegacyResourceFile *LegacyResourceFileOptions ProviderName string ProviderSource string RegistryDataSourceFile *RegistryDataSourceFileOptions RegistryEphemeralFile *RegistryEphemeralFileOptions RegistryFunctionFile *RegistryFunctionFileOptions RegistryGuideFile *RegistryGuideFileOptions RegistryIndexFile *RegistryIndexFileOptions RegistryResourceFile *RegistryResourceFileOptions IgnoreCdktfMissingFiles bool }
type ContentsCheck ¶
type ContentsCheck struct {
Options *ContentsOptions
}
func NewContentsCheck ¶
func NewContentsCheck(opts *ContentsOptions) *ContentsCheck
type ContentsOptions ¶
type ContentsOptions struct { *FileOptions Enable bool ProviderName string RequireSchemaOrdering bool }
ContentsOptions represents configuration options for Contents.
type FileMismatchCheck ¶
type FileMismatchCheck struct {
Options *FileMismatchOptions
}
func NewFileMismatchCheck ¶
func NewFileMismatchCheck(opts *FileMismatchOptions) *FileMismatchCheck
func (*FileMismatchCheck) IgnoreFileMismatch ¶
func (check *FileMismatchCheck) IgnoreFileMismatch(file string) bool
func (*FileMismatchCheck) IgnoreFileMissing ¶
func (check *FileMismatchCheck) IgnoreFileMissing(resourceName string) bool
func (*FileMismatchCheck) Run ¶
func (check *FileMismatchCheck) Run(files []string) error
type FileMismatchOptions ¶
type FileOptions ¶
type FileOptions struct {
BasePath string
}
func (*FileOptions) FullPath ¶
func (opts *FileOptions) FullPath(path string) string
FullPath returns the full path of the file, combining path portions from opts.BasePath and path.
type FrontMatterCheck ¶
type FrontMatterCheck struct {
Options *FrontMatterOptions
}
func NewFrontMatterCheck ¶
func NewFrontMatterCheck(opts *FrontMatterOptions) *FrontMatterCheck
func (*FrontMatterCheck) Run ¶
func (check *FrontMatterCheck) Run(src []byte) error
type FrontMatterData ¶
type FrontMatterData struct { Description *string `yaml:"description,omitempty"` Layout *string `yaml:"layout,omitempty"` PageTitle *string `yaml:"page_title,omitempty"` SidebarCurrent *string `yaml:"sidebar_current,omitempty"` Subcategory *string `yaml:"subcategory,omitempty"` }
FrontMatterData represents the YAML frontmatter of Terraform Provider documentation.
type FrontMatterOptions ¶
type FrontMatterOptions struct { AllowedSubcategories []string NoDescription bool NoLayout bool NoPageTitle bool NoSidebarCurrent bool NoSubcategory bool RequireDescription bool RequireLayout bool RequirePageTitle bool RequireSubcategory bool }
FrontMatterOptions represents configuration options for FrontMatter.
type LegacyDataSourceFileCheck ¶
type LegacyDataSourceFileCheck struct { FileCheck Options *LegacyDataSourceFileOptions }
func NewLegacyDataSourceFileCheck ¶
func NewLegacyDataSourceFileCheck(opts *LegacyDataSourceFileOptions) *LegacyDataSourceFileCheck
func (*LegacyDataSourceFileCheck) Run ¶
func (check *LegacyDataSourceFileCheck) Run(path string) error
func (*LegacyDataSourceFileCheck) RunAll ¶
func (check *LegacyDataSourceFileCheck) RunAll(files []string) error
type LegacyDataSourceFileOptions ¶
type LegacyDataSourceFileOptions struct { *FileOptions FrontMatter *FrontMatterOptions }
type LegacyEphemeralFileCheck ¶ added in v0.16.0
type LegacyEphemeralFileCheck struct { FileCheck Options *LegacyEphemeralFileOptions }
func NewLegacyEphemeralFileCheck ¶ added in v0.16.0
func NewLegacyEphemeralFileCheck(opts *LegacyEphemeralFileOptions) *LegacyEphemeralFileCheck
type LegacyEphemeralFileOptions ¶ added in v0.16.0
type LegacyEphemeralFileOptions struct { *FileOptions Contents *ContentsOptions FrontMatter *FrontMatterOptions ProviderName string }
type LegacyFunctionFileCheck ¶ added in v0.12.0
type LegacyFunctionFileCheck struct { FileCheck Options *LegacyFunctionFileOptions }
func NewLegacyFunctionFileCheck ¶ added in v0.12.0
func NewLegacyFunctionFileCheck(opts *LegacyFunctionFileOptions) *LegacyFunctionFileCheck
func (*LegacyFunctionFileCheck) Run ¶ added in v0.12.0
func (check *LegacyFunctionFileCheck) Run(path string) error
func (*LegacyFunctionFileCheck) RunAll ¶ added in v0.12.0
func (check *LegacyFunctionFileCheck) RunAll(files []string) error
type LegacyFunctionFileOptions ¶ added in v0.12.0
type LegacyFunctionFileOptions struct { *FileOptions FrontMatter *FrontMatterOptions }
type LegacyGuideFileCheck ¶
type LegacyGuideFileCheck struct { FileCheck Options *LegacyGuideFileOptions }
func NewLegacyGuideFileCheck ¶
func NewLegacyGuideFileCheck(opts *LegacyGuideFileOptions) *LegacyGuideFileCheck
func (*LegacyGuideFileCheck) Run ¶
func (check *LegacyGuideFileCheck) Run(path string) error
func (*LegacyGuideFileCheck) RunAll ¶
func (check *LegacyGuideFileCheck) RunAll(files []string) error
type LegacyGuideFileOptions ¶
type LegacyGuideFileOptions struct { *FileOptions FrontMatter *FrontMatterOptions }
type LegacyIndexFileCheck ¶
type LegacyIndexFileCheck struct { FileCheck Options *LegacyIndexFileOptions }
func NewLegacyIndexFileCheck ¶
func NewLegacyIndexFileCheck(opts *LegacyIndexFileOptions) *LegacyIndexFileCheck
func (*LegacyIndexFileCheck) Run ¶
func (check *LegacyIndexFileCheck) Run(path string) error
func (*LegacyIndexFileCheck) RunAll ¶
func (check *LegacyIndexFileCheck) RunAll(files []string) error
type LegacyIndexFileOptions ¶
type LegacyIndexFileOptions struct { *FileOptions FrontMatter *FrontMatterOptions }
type LegacyResourceFileCheck ¶
type LegacyResourceFileCheck struct { FileCheck Options *LegacyResourceFileOptions }
func NewLegacyResourceFileCheck ¶
func NewLegacyResourceFileCheck(opts *LegacyResourceFileOptions) *LegacyResourceFileCheck
type LegacyResourceFileOptions ¶
type LegacyResourceFileOptions struct { *FileOptions Contents *ContentsOptions FrontMatter *FrontMatterOptions ProviderName string }
type RegistryDataSourceFileCheck ¶
type RegistryDataSourceFileCheck struct { FileCheck Options *RegistryDataSourceFileOptions }
func NewRegistryDataSourceFileCheck ¶
func NewRegistryDataSourceFileCheck(opts *RegistryDataSourceFileOptions) *RegistryDataSourceFileCheck
func (*RegistryDataSourceFileCheck) Run ¶
func (check *RegistryDataSourceFileCheck) Run(path string) error
func (*RegistryDataSourceFileCheck) RunAll ¶
func (check *RegistryDataSourceFileCheck) RunAll(files []string) error
type RegistryDataSourceFileOptions ¶
type RegistryDataSourceFileOptions struct { *FileOptions FrontMatter *FrontMatterOptions }
type RegistryEphemeralFileCheck ¶ added in v0.16.0
type RegistryEphemeralFileCheck struct { FileCheck Options *RegistryEphemeralFileOptions }
func NewRegistryEphemeralFileCheck ¶ added in v0.16.0
func NewRegistryEphemeralFileCheck(opts *RegistryEphemeralFileOptions) *RegistryEphemeralFileCheck
type RegistryEphemeralFileOptions ¶ added in v0.16.0
type RegistryEphemeralFileOptions struct { *FileOptions Contents *ContentsOptions FrontMatter *FrontMatterOptions ProviderName string }
type RegistryFunctionFileCheck ¶ added in v0.12.0
type RegistryFunctionFileCheck struct { FileCheck Options *RegistryFunctionFileOptions }
func NewRegistryFunctionFileCheck ¶ added in v0.12.0
func NewRegistryFunctionFileCheck(opts *RegistryFunctionFileOptions) *RegistryFunctionFileCheck
func (*RegistryFunctionFileCheck) Run ¶ added in v0.12.0
func (check *RegistryFunctionFileCheck) Run(path string) error
func (*RegistryFunctionFileCheck) RunAll ¶ added in v0.12.0
func (check *RegistryFunctionFileCheck) RunAll(files []string) error
type RegistryFunctionFileOptions ¶ added in v0.12.0
type RegistryFunctionFileOptions struct { *FileOptions FrontMatter *FrontMatterOptions }
type RegistryGuideFileCheck ¶
type RegistryGuideFileCheck struct { FileCheck Options *RegistryGuideFileOptions }
func NewRegistryGuideFileCheck ¶
func NewRegistryGuideFileCheck(opts *RegistryGuideFileOptions) *RegistryGuideFileCheck
func (*RegistryGuideFileCheck) Run ¶
func (check *RegistryGuideFileCheck) Run(path string) error
func (*RegistryGuideFileCheck) RunAll ¶
func (check *RegistryGuideFileCheck) RunAll(files []string) error
type RegistryGuideFileOptions ¶
type RegistryGuideFileOptions struct { *FileOptions FrontMatter *FrontMatterOptions }
type RegistryIndexFileCheck ¶
type RegistryIndexFileCheck struct { FileCheck Options *RegistryIndexFileOptions }
func NewRegistryIndexFileCheck ¶
func NewRegistryIndexFileCheck(opts *RegistryIndexFileOptions) *RegistryIndexFileCheck
func (*RegistryIndexFileCheck) Run ¶
func (check *RegistryIndexFileCheck) Run(path string) error
func (*RegistryIndexFileCheck) RunAll ¶
func (check *RegistryIndexFileCheck) RunAll(files []string) error
type RegistryIndexFileOptions ¶
type RegistryIndexFileOptions struct { *FileOptions FrontMatter *FrontMatterOptions }
type RegistryResourceFileCheck ¶
type RegistryResourceFileCheck struct { FileCheck Options *RegistryResourceFileOptions }
func NewRegistryResourceFileCheck ¶
func NewRegistryResourceFileCheck(opts *RegistryResourceFileOptions) *RegistryResourceFileCheck
type RegistryResourceFileOptions ¶
type RegistryResourceFileOptions struct { *FileOptions Contents *ContentsOptions FrontMatter *FrontMatterOptions ProviderName string }
Source Files ¶
- check.go
- contents.go
- directory.go
- file.go
- file_extension.go
- file_mismatch.go
- frontmatter.go
- legacy_data_source_file.go
- legacy_ephemeral_file.go
- legacy_function_file.go
- legacy_guide_file.go
- legacy_index_file.go
- legacy_resource_file.go
- registry_data_source_file.go
- registry_ephemeral_file.go
- registry_function_file.go
- registry_guide_file.go
- registry_index_file.go
- registry_resource_file.go
Click to show internal directories.
Click to hide internal directories.