Skip to content

Conversation

@JakobJingleheimer
Copy link
Member

Co-authorship lines contain an email address which is very likely longer than 72 characters (any github-anonymised email address), which cannot be broken across multiple lines.

@JakobJingleheimer
Copy link
Member Author

@targos strangely, I can't tag people for review O.o

cc @joyeecheung

// Skip lines with URLs.
if (/https?:\/\//.test(line)) { continue }
// Skip co-authorship.
if (line.startsWith('Co-Authored-By')) { continue }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be more useful to properly validate the format (i.e. flag Co-authored-by: Author Name But No Email, etc.)

Also, could you add tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Email is what causes the issue though

JakobJingleheimer and others added 4 commits December 22, 2025 10:40
Co-authored-by: Michaël Zasso <targos@protonmail.com>
per existing `co-authored-by-is-trailer` rule's regex
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Comment on lines +141 to +144
message: `
fixup!: apply case-insensitive suggestion
Co-authored-by: Michaël Zasso <37011812+targos@users.noreply.github.com>
`
Copy link
Contributor

@aduh95 aduh95 Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not a good test, it passes without your patch because of the leading spaces

Suggested change
message: `
fixup!: apply case-insensitive suggestion
Co-authored-by: Michaël Zasso <37011812+targos@users.noreply.github.com>
`
message: [
'fixup!: apply case-insensitive suggestion',
'Co-authored-by: Michaël Zasso <37011812+targos@users.noreply.github.com>',
].join('\n')

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should fail though, no?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good regression test fails without the patch, and passes with it. Currently the test passes with and without your patch. If we want a good regression test (we do), we want one that fails without the patch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I mean it seems suspicious that it isn't failing, which would suggest the implementation is bugged.

// Skip lines with URLs.
if (/https?:\/\//.test(line)) { continue }
// Skip co-authorship.
if (/^co-authored-by:/i.test(line)) { continue }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'm not sure it's worth doing, but we could have a shared util to avoid duplicating the regex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants