Skip to content

Commit 65fa27e

Browse files
cbleckerclaude
andcommitted
Require exactly 61 dashes for YAML header separators
Update regex to match exactly 61 dashes instead of 3+ for better consistency and error detection. This matches the actual format used in all candidate files and will help catch formatting errors. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent d297be6 commit 65fa27e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

hack/verify-steering-election-tool.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,10 @@ func validateTemplateCompliance(filename string) error {
292292
}
293293

294294
// extractYAMLHeader extracts the YAML content between dash separators
295+
// The format requires exactly 61 dashes for consistency
295296
func extractYAMLHeader(content string) (string, error) {
296-
// Find the YAML header between dashes
297-
dashRegex := regexp.MustCompile(`(?s)^-{5,}\s*\n(.*?)\n-{5,}\s*\n`)
297+
// Find the YAML header between exactly 61 dashes
298+
dashRegex := regexp.MustCompile(`(?s)^-{61}\s*\n(.*?)\n-{61}\s*\n`)
298299
matches := dashRegex.FindStringSubmatch(content)
299300
if len(matches) != 2 {
300301
return "", fmt.Errorf("could not find YAML header between dashes")

0 commit comments

Comments
 (0)