Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbeff4c9

Browse files
mariotackealexcanessa
authored andcommitted
Replace commit author name with login (#175)
GitHub markdown converts @-references with links to user profiles. Usingthe full author name means potentially including a space which breaks thislinking behavior. Instead of the author name (Ex: Mario Tacke), this fixuses the author login (Ex: mariotacke) to form a proper link in therelease notes and changelog).Thisfixes#158
1 parentc923505 commitbeff4c9

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

‎lib/src/Gren.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,12 +465,12 @@ class Gren {
465465
*@return {string}
466466
*/
467467
// eslint-disable-next-line camelcase
468-
_templateCommits({ sha, html_url,commit:{author:{name}, message}}){
468+
_templateCommits({ sha, html_url,commit:{author:{login}, message}}){
469469
returngenerate({
470470
sha,
471471
message:message.split('\n')[0],
472472
url:html_url,
473-
author:name
473+
author:login
474474
},this.options.template.commit);
475475
}
476476

‎test/Gren.spec.js‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -345,31 +345,31 @@ describe('Gren', () => {
345345
commit:{
346346
message:'First commit',
347347
author:{
348-
name:'alexcanessa'
348+
login:'alexcanessa'
349349
}
350350
}
351351
},
352352
{
353353
commit:{
354354
message:'This is another commit',
355355
author:{
356-
name:'alexcanessa'
356+
login:'alexcanessa'
357357
}
358358
}
359359
},
360360
{
361361
commit:{
362362
message:'Merge branch into master: Something else here to be tested',
363363
author:{
364-
name:'alexcanessa'
364+
login:'alexcanessa'
365365
}
366366
}
367367
},
368368
{
369369
commit:{
370370
message:'This is the last one',
371371
author:{
372-
name:'alexcanessa'
372+
login:'alexcanessa'
373373
}
374374
}
375375
}
@@ -387,52 +387,52 @@ describe('Gren', () => {
387387
it('Should not return the last message',()=>{
388388
constlastMessage=commitMessages.slice(-1)[0];
389389

390-
assert.notInclude(gren._generateCommitsBody(commitMessages),`${lastMessage.commit.message} -${lastMessage.commit.author.name}`,'Generate the messages');
390+
assert.notInclude(gren._generateCommitsBody(commitMessages),`${lastMessage.commit.message} -${lastMessage.commit.author.login}`,'Generate the messages');
391391
assert.deepEqual(gren._generateCommitsBody([{
392392
commit:{
393393
message:'One message',
394394
author:{
395-
name:'alexcanessa'
395+
login:'alexcanessa'
396396
}
397397
}
398398
}]),'One message - alexcanessa','One message passed');
399399
assert.deepEqual(gren._generateCommitsBody([{
400400
commit:{
401401
message:'One',
402402
author:{
403-
name:'alexcanessa'
403+
login:'alexcanessa'
404404
}
405405
}
406406
},
407407
{
408408
commit:{
409409
message:'Two',
410410
author:{
411-
name:'alexcanessa'
411+
login:'alexcanessa'
412412
}
413413
}
414414
}]),'One - alexcanessa','Two message passed');
415415
assert.deepEqual(gren._generateCommitsBody([{
416416
commit:{
417417
message:'One',
418418
author:{
419-
name:'alexcanessa'
419+
login:'alexcanessa'
420420
}
421421
}
422422
},
423423
{
424424
commit:{
425425
message:'Two',
426426
author:{
427-
name:'alexcanessa'
427+
login:'alexcanessa'
428428
}
429429
}
430430
},
431431
{
432432
commit:{
433433
message:'Three',
434434
author:{
435-
name:'alexcanessa'
435+
login:'alexcanessa'
436436
}
437437
}
438438
}]),'One - alexcanessa\nTwo - alexcanessa','Three message passed');
@@ -441,7 +441,7 @@ describe('Gren', () => {
441441
it('Should only return the messages defined in the options',()=>{
442442
gren.options.includeMessages='commits';
443443

444-
constmessages=msg=>`${commitMessages[msg].commit.message} -${commitMessages[msg].commit.author.name}`;
444+
constmessages=msg=>`${commitMessages[msg].commit.message} -${commitMessages[msg].commit.author.login}`;
445445

446446
assert.deepEqual(gren._generateCommitsBody(commitMessages),`${messages(0)}\n${messages(1)}`,'Using commits as includeMessages');
447447

@@ -455,7 +455,7 @@ describe('Gren', () => {
455455
it('Should not return commits with ignored words',()=>{
456456
gren.options.ignoreCommitsWith=['another'];
457457

458-
constmessages=msg=>`${commitMessages[msg].commit.message} -${commitMessages[msg].commit.author.name}`;
458+
constmessages=msg=>`${commitMessages[msg].commit.message} -${commitMessages[msg].commit.author.login}`;
459459

460460
assert.notInclude(commitMessages.filter(message=>gren._filterCommit(message)),messages(1),'Ignore another');
461461
});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp