From 8d5f63ada67f07d0f7c820bcdc157de6bc1a115c Mon Sep 17 00:00:00 2001 From: Max Leske Date: Fri, 15 Sep 2023 15:06:14 +0200 Subject: [PATCH] fix: use correct URL in regex assembly standard header --- cmd/regex_format.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/regex_format.go b/cmd/regex_format.go index 3b33dc0..323d413 100644 --- a/cmd/regex_format.go +++ b/cmd/regex_format.go @@ -22,7 +22,7 @@ import ( "github.com/coreruleset/crs-toolchain/regex/processors" ) -const regexAssemblyStandardHeader = "##! Please refer to the documentation at\n##! https://coreruleset.org/docs/development/crs_toolchain/.\n" +const regexAssemblyStandardHeader = "##! Please refer to the documentation at\n##! https://coreruleset.org/docs/development/regex_assembly/.\n" // formatCmd represents the generate command var formatCmd = createFormatCommand() @@ -285,8 +285,8 @@ func formatEndOfFile(lines []string) []string { } func checkStandardHeader(lines []string) bool { - if len(lines) > 2 && - lines[0]+lines[1] == regexAssemblyStandardHeader { + if len(lines) >= 3 && + fmt.Sprintf("%s\n%s\n%s", lines[0], lines[1], lines[2]) == regexAssemblyStandardHeader { return true } return false