in tools/go-changelog/note.go [87:139]
func (n *Note) Validate() *EntryValidationError {
typ := n.Type
content := n.Body
if !TypeValid(typ) {
return &EntryValidationError{
message: fmt.Sprintf("unknown changelog types %v: please use only the configured changelog entry types: %v", typ, content),
Code: EntryErrorUnknownTypes,
Details: map[string]interface{}{
"type": typ,
"note": content,
},
}
}
if newlineRegexp.MatchString(content) {
return &EntryValidationError{
message: fmt.Sprintf("multiple lines are found in changelog entry %v: Please only have one CONTENT line per release note block. Use multiple blocks if there are multiple related changes in a single PR.", content),
Code: EntryErrorMultipleLines,
Details: map[string]interface{}{
"type": typ,
"note": content,
},
}
}
if typ == "new-resource" || typ == "new-datasource" {
if !newResourceOrDatasourceRegexp.MatchString(content) {
return &EntryValidationError{
message: fmt.Sprintf("invalid resource/datasource format in changelog entry %v: Please follow format in https://googlecloudplatform.github.io/magic-modules/contribute/release-notes/#type-specific-guidelines-and-examples", content),
Code: EntryErrorInvalidNewReourceOrDatasourceFormat,
Details: map[string]interface{}{
"type": typ,
"note": content,
},
}
}
}
if typ == "enhancement" || typ == "bug" {
if !enhancementOrBugFixRegexp.MatchString(content) {
return &EntryValidationError{
message: fmt.Sprintf("invalid enhancement/bug fix format in changelog entry %v: Please follow format in https://googlecloudplatform.github.io/magic-modules/contribute/release-notes/#type-specific-guidelines-and-examples", content),
Code: EntryErrorInvalidEnhancementOrBugFixFormat,
Details: map[string]interface{}{
"type": typ,
"note": content,
},
}
}
}
return nil
}