Do not accept commits with no empty string after header #8
Labels
No labels
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/dco-go#8
Loading…
Reference in a new issue
No description provided.
Delete branch "elebedeva/dco-go:feat/check-empty-string-after-header"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Close #7
Signed-off-by: Ekaterina Lebedeva ekaterina.lebedeva@yadro.com
@ -78,2 +86,4 @@
}
// Check empty line after header.
if !rxEmptyLine.MatchString(lines[1]) {
Why not
lines[1] != ""
?I wanted to maintain the general style. Removed.
@ -72,0 +73,4 @@
// Do not process commits shorter than 3 lines.
if len(lines) < 3 {
fail = true
fmt.Printf("Error: commit is too short [%s]\n", id)
It is not an error, commits without long description are valid
(we have signoff, so it will always be >=3 lines, but still, this error is not useful and we have a separate one for signoff
We can use
1 < len(lines) && lines[1] != ""
in the condition below to avoid panic.fixed
5b73349910
toa9d9c0d077