isCustomConfigFile returns true if the file exists and is not marked with the standard DDEV signature, OR if the file has DDEV markers but is not in the expectedDdevFiles list (indicating an unexpected DDEV-generated file). Files with the #ddev-silent-no-warn marker are excluded unless showAll is tr
(filePath string, expectedDdevFiles []string, hasDdevSig, hasSilentNoWarn bool, showAll bool)
| 445 | // the expectedDdevFiles list (indicating an unexpected DDEV-generated file). |
| 446 | // Files with the #ddev-silent-no-warn marker are excluded unless showAll is true. |
| 447 | func isCustomConfigFile(filePath string, expectedDdevFiles []string, hasDdevSig, hasSilentNoWarn bool, showAll bool) bool { |
| 448 | filename := filepath.Base(filePath) |
| 449 | // Exclude example files |
| 450 | if strings.HasSuffix(filename, ".example") || filename == "README.txt" { |
| 451 | return false |
| 452 | } |
| 453 | |
| 454 | // Files with #ddev-silent-no-warn marker are only excluded if showAll is false |
| 455 | if !showAll && hasSilentNoWarn { |
| 456 | return false |
| 457 | } |
| 458 | |
| 459 | // If file has DDEV marker, check if it's in the expected list |
| 460 | if hasDdevSig { |
| 461 | if slices.Contains(expectedDdevFiles, filePath) { |
| 462 | return false // Expected DDEV file, not custom |
| 463 | } |
| 464 | // Has DDEV marker but not in expected list = unexpected = custom |
| 465 | return true |
| 466 | } |
| 467 | |
| 468 | // No DDEV marker = custom |
| 469 | return true |
| 470 | } |
| 471 | |
| 472 | // fileInfo represents a config file with metadata |
| 473 | type fileInfo struct { |
no outgoing calls
no test coverage detected