File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed
Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -29,10 +29,14 @@ export default {
2929 let failed = false
3030 for ( let i = 0 ; i < parsed . body . length ; i ++ ) {
3131 const line = parsed . body [ i ]
32+
3233 // Skip quoted lines, e.g. for original commit messages of V8 backports.
3334 if ( line . startsWith ( ' ' ) ) { continue }
3435 // Skip lines with URLs.
3536 if ( / h t t p s ? : \/ \/ / . test ( line ) ) { continue }
37+ // Skip co-authorship.
38+ if ( / ^ c o - a u t h o r e d - b y : / i. test ( line ) ) { continue }
39+
3640 if ( line . length > len ) {
3741 failed = true
3842 context . report ( {
Original file line number Diff line number Diff line change @@ -129,5 +129,37 @@ https://${'very-'.repeat(80)}-long-url.org/
129129 tt . end ( )
130130 } )
131131
132+ t . test ( 'Co-author lines' , ( tt ) => {
133+ const v = new Validator ( )
134+
135+ const good = new Commit ( {
136+ sha : 'f1496de5a7d5474e39eafaafe6f79befe5883a5b' ,
137+ author : {
138+ name : 'Jacob Smith' ,
139+ email : '3012099+JakobJingleheimer@users.noreply.github.com' ,
140+ date : '2025-12-22T09:40:42Z'
141+ } ,
142+ message : [
143+ 'fixup!: apply case-insensitive suggestion' ,
144+ 'Co-authored-by: Michaël Zasso <37011812+targos@users.noreply.github.com>'
145+ ] . join ( '\n' )
146+ } , v )
147+
148+ good . report = ( opts ) => {
149+ tt . pass ( 'called report' )
150+ tt . equal ( opts . id , 'line-length' , 'id' )
151+ tt . equal ( opts . string , '' , 'string' )
152+ tt . equal ( opts . level , 'pass' , 'level' )
153+ }
154+
155+ Rule . validate ( good , {
156+ options : {
157+ length : 72
158+ }
159+ } )
160+
161+ tt . end ( )
162+ } )
163+
132164 t . end ( )
133165} )
You can’t perform that action at this time.
0 commit comments