File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -452,6 +452,16 @@ LUM-2345'
452452 [[ " $status " -eq 0 ]]
453453}
454454
455+ @test " body with 100+ line length should be valid if no space" {
456+ MESSAGE='
457+ 0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_
458+
459+ LUM-2345'
460+
461+ run validate_body_length " $MESSAGE "
462+ [[ " $status " -eq 0 ]]
463+ }
464+
455465@test " body with trailing space on line should not be valid" {
456466 MESSAGE=' pdzofjzf '
457467
@@ -612,7 +622,7 @@ LUM-2345'
612622@test " overall validation invalid body length" {
613623 MESSAGE=' feat(scope1): subject
614624
615- 12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901
625+ 1 2 3 4 5678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901
616626
617627LUM-2345'
618628
Original file line number Diff line number Diff line change @@ -189,6 +189,9 @@ validate_body_length() {
189189
190190 while IFS= read -r LINE ;
191191 do
192+ # Skip lines with no spaces as they can't be split
193+ $( echo -n " $LINE " | grep -q " \s" ) || continue
194+
192195 local LENGTH
193196
194197 LENGTH=" $( echo -n " $LINE " | wc -c) "
You can’t perform that action at this time.
0 commit comments