Do not accept commits with no empty string after header #8

Merged
fyrchik merged 1 commit from elebedeva/dco-go:feat/check-empty-string-after-header into master 2024-06-27 06:48:12 +00:00
Member

Close #7

Signed-off-by: Ekaterina Lebedeva ekaterina.lebedeva@yadro.com

Close #7 Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
elebedeva requested review from fyrchik 2024-06-26 10:09:25 +00:00
elebedeva requested review from alexvanin 2024-06-26 10:09:25 +00:00
fyrchik requested changes 2024-06-26 10:41:58 +00:00
main.go Outdated
@ -78,2 +86,4 @@
}
// Check empty line after header.
if !rxEmptyLine.MatchString(lines[1]) {
Owner

Why not lines[1] != ""?

Why not `lines[1] != ""`?
Author
Member

I wanted to maintain the general style. Removed.

I wanted to maintain the general style. Removed.
fyrchik reviewed 2024-06-26 10:44:21 +00:00
main.go Outdated
@ -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)
Owner

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.

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.
Author
Member

fixed

fixed
elebedeva force-pushed feat/check-empty-string-after-header from 5b73349910 to a9d9c0d077 2024-06-26 19:27:28 +00:00 Compare
fyrchik approved these changes 2024-06-27 06:41:54 +00:00
alexvanin approved these changes 2024-06-27 06:45:19 +00:00
fyrchik merged commit a9d9c0d077 into master 2024-06-27 06:48:12 +00:00
Sign in to join this conversation.
No description provided.