-
-
Notifications
You must be signed in to change notification settings - Fork 53
feat: support co-authorship lines in body #130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 6 commits
37e4e88
f1496de
f778e67
5004df9
d7c76aa
dc6b810
f05715d
69779f0
01a658c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -129,5 +129,35 @@ https://${'very-'.repeat(80)}-long-url.org/ | |||||||||||||||||||||
| tt.end() | ||||||||||||||||||||||
| }) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| t.test('Co-author lines', (tt) => { | ||||||||||||||||||||||
| const v = new Validator() | ||||||||||||||||||||||
| const context = new Commit({ | ||||||||||||||||||||||
| sha: 'f1496de5a7d5474e39eafaafe6f79befe5883a5b', | ||||||||||||||||||||||
| author: { | ||||||||||||||||||||||
| name: 'Jacob Smith', | ||||||||||||||||||||||
| email: '[email protected]', | ||||||||||||||||||||||
| date: '2025-12-22T09:40:42Z' | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| message: ` | ||||||||||||||||||||||
| fixup!: apply case-insensitive suggestion | ||||||||||||||||||||||
| Co-authored-by: Michaël Zasso <[email protected]> | ||||||||||||||||||||||
| ` | ||||||||||||||||||||||
|
||||||||||||||||||||||
| 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 <[email protected]>', | |
| ].join('\n') |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I discovered why the test is suspiciously passing:
core-validate-commit/lib/rules/line-length.js
Lines 32 to 33 in 39b93a3
| // Skip quoted lines, e.g. for original commit messages of V8 backports. | |
| if (line.startsWith(' ')) { continue } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(@aduh95 I don't know what to do about it)
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I think if we need it in a third place, then it's worth having a shared util.