INNER CODE UNIT · Go

MixedDirectoriesCheck

hashicorp/terraform-plugin-docs · internal/check/directory.go:114

func MixedDirectoriesCheck(docFiles []string) error {
	var legacyDirectoryFound bool
	var registryDirectoryFound bool
	err := fmt.Errorf("mixed Terraform Provider documentation directory layouts found, must use only legacy or registry layout")

	for _, file := range docFiles {
		directory := path.Dir(file)
		log.Printf("[DEBUG] Found directory: %s", directory)

		// Allow docs/ with other files
		if IsValidRegistryDirectory(directory) && directory != RegistryIndexDirectory {
			registryDirectoryFound = true

			if legacyDirectoryFound {
				log.Printf("[DEBUG] Found mixed directories")
				return err
			}
		}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…