1
1
# issue-parser
2
2
3
- Parser for Github, GitLab and Bitbucket issues actions, references and mentions
3
+ Parser for [ Github] ( https://github.com ) , [ GitLab] ( https://gitlab.com ) , [ Bitbucket ] ( https://bitbucket.org ) and [ Waffle ] ( https://waffle.io ) issues actions, references and mentions
4
4
5
5
[ ![ Travis] ( https://img.shields.io/travis/pvdlg/issue-parser.svg )] ( https://travis-ci.org/pvdlg/issue-parser )
6
6
[ ![ Codecov] ( https://img.shields.io/codecov/c/github/pvdlg/issue-parser.svg )] ( https://codecov.io/gh/pvdlg/issue-parser )
@@ -10,6 +10,7 @@ The parser can identify:
10
10
- GitHub [ closing keywords] ( https://help.github.com/articles/closing-issues-using-keywords ) , [ duplicate keyword] ( https://help.github.com/articles/about-duplicate-issues-and-pull-requests ) , [ issue references] ( https://guides.github.com/features/issues/#notifications ) and [ user mentions] ( https://guides.github.com/features/issues/#notifications )
11
11
- GitLab [ closing keywords] ( https://docs.gitlab.com/ee/user/project/issues/automatic_issue_closing.html ) , [ duplicate keyword] ( https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/12845 ) , [ issue references] ( https://about.gitlab.com/2016/03/08/gitlab-tutorial-its-all-connected ) and [ user mentions] ( https://about.gitlab.com/2016/03/08/gitlab-tutorial-its-all-connected )
12
12
- Bitbucket [ closing keywords] ( https://confluence.atlassian.com/bitbucket/resolve-issues-automatically-when-users-push-code-221451126.html ) , [ issue references] ( https://confluence.atlassian.com/bitbucket/mark-up-comments-issues-and-commit-messages-321859781.html ) and [ user mentions] ( https://confluence.atlassian.com/bitbucket/mark-up-comments-issues-and-commit-messages-321859781.html )
13
+ - Waffle.io [ epics] ( https://help.waffle.io/epics/which-keywords-are-supported-with-epics ) and [ dependencies] ( https://help.waffle.io/dependencies/which-keywords-are-supported-with-dependencies ) keywords
13
14
14
15
## Install
15
16
@@ -67,7 +68,26 @@ parse('Issue description, ref user/package#1, fixing #2. /cc @user');
67
68
{
68
69
refs: [{raw: 'user/package#1', slug: 'user/package', prefix: '#', issue: '1'}],
69
70
actions: [{raw: 'fixing #2', action: 'Fixing', prefix: '#', issue: '2'}],
70
- duplicates: [],
71
+ mentions: [{raw: '@user', prefix: '@', user: 'user'}],
72
+ }
73
+ */
74
+ ```
75
+
76
+ ### Waffle format
77
+
78
+ ``` js
79
+ const issueParser = require (' issue-parser' );
80
+ const parse = issueParser (' waffle' );
81
+
82
+ parse (' Issue description, ref user/package#1, Fix #2, blocks user/package#3, Require #4, Parent of #5, Child of #6 /cc @user' );
83
+ /*
84
+ {
85
+ refs: [{raw: 'user/package#1', slug: 'user/package', prefix: '#', issue: '1'}],
86
+ actions: [{raw: 'Fix #2', action: 'Fix', prefix: '#', issue: '2'}],
87
+ blocks: [{raw: 'blocks user/package#3', action: 'Blocks', slug: 'user/package', prefix: '#', issue: '3'}],
88
+ requires: [{raw: 'Require #4', action: 'Require', prefix: '#', issue: '4'}],
89
+ parentOf: [{raw: 'Parent of #5', action: 'Parent of', prefix: '#', issue: '5'}],
90
+ childOf: [{raw: 'Child of #6', action: 'Child of', prefix: '#', issue: '6'}],
71
91
mentions: [{raw: '@user', prefix: '@', user: 'user'}],
72
92
}
73
93
*/
@@ -77,15 +97,14 @@ parse('Issue description, ref user/package#1, fixing #2. /cc @user');
77
97
78
98
``` js
79
99
const issueParser = require (' issue-parser' );
80
- const parse = issueParser ({referenceActions: [' complete' ], issuePrefixes: [' 🐛' ]});
100
+ const parse = issueParser ({referenceActions: [' complete' ], blocksActions : [ ' holds up ' ], issuePrefixes: [' 🐛' ]});
81
101
82
- parse (' Issue description, related to user/package🐛1, Complete 🐛2' );
102
+ parse (' Issue description, related to user/package🐛1, Complete 🐛2, holds up 🐛3 ' );
83
103
/*
84
104
{
85
105
refs: [{raw: 'user/package🐛1', slug: 'user/package', prefix: '🐛', issue: '1'}],
86
106
actions: [{raw: 'Complete 🐛2', action: 'Complete', prefix: '🐛', issue: '2'}],
87
- duplicates: [],
88
- mentions: [],
107
+ blocks: [{raw: 'holds up 🐛3', action: 'Holds up', prefix: '🐛', issue: '3'}],
89
108
}
90
109
*/
91
110
```
@@ -282,6 +301,34 @@ Default: `['close', 'closes', 'closed', 'closing', 'fix', 'fixes', 'fixed', 'fix
282
301
283
302
List of action keywords used to close issues and pull requests.
284
303
304
+ ##### blocksActions
305
+
306
+ Type: ` Array<String> ` ` String ` <br >
307
+ Default: ` ['blocks', 'block', 'required by', 'needed by', 'dependency of'] `
308
+
309
+ List of action keywords used to make an issue or pull request block another one.
310
+
311
+ ##### requiresActions
312
+
313
+ Type: ` Array<String> ` ` String ` <br >
314
+ Default: ` ['blocked by', 'requires', 'require', 'need', 'needs', 'depends on'] `
315
+
316
+ List of action keywords used to make an issue or pull request blocked by another one.
317
+
318
+ ##### parentOfActions
319
+
320
+ Type: ` Array<String> ` ` String ` <br >
321
+ Default: ` ['parent of', 'parent to', 'parent'] `
322
+
323
+ List of action keywords used to make an issue or pull request the parent of another one.
324
+
325
+ ##### childOfActions
326
+
327
+ Type: ` Array<String> ` ` String ` <br >
328
+ Default: ` ['child of', 'child to', 'child'] `
329
+
330
+ List of action keywords used to make an issue or pull request the child of another one.
331
+
285
332
##### duplicateActions
286
333
287
334
Type: ` Array<String> ` ` String ` <br >
@@ -355,6 +402,66 @@ Each action has the following properties:
355
402
| prefix | ` String ` | The prefix used to identify the issue. |
356
403
| issue | ` String ` | The issue number. |
357
404
405
+ #### blocks
406
+
407
+ Type: ` Array<Object> `
408
+
409
+ List of issues and pull requests blocked.<br >
410
+ Each action has the following properties:
411
+
412
+ | Name | Type | Description |
413
+ | --------| ----------| ---------------------------------------------------------------------------------------|
414
+ | raw | ` String ` | The raw value parsed, for example ` Blocks #1 ` . |
415
+ | action | ` String ` | The keyword used to identify the action, capitalized. |
416
+ | slug | ` String ` | The repository owner and name, for issue referred as ` <owner>/<repo>#<issue number> ` . |
417
+ | prefix | ` String ` | The prefix used to identify the issue. |
418
+ | issue | ` String ` | The issue number. |
419
+
420
+ #### requires
421
+
422
+ Type: ` Array<Object> `
423
+
424
+ List of issues and pull requests required.<br >
425
+ Each action has the following properties:
426
+
427
+ | Name | Type | Description |
428
+ | --------| ----------| ---------------------------------------------------------------------------------------|
429
+ | raw | ` String ` | The raw value parsed, for example ` Requires #1 ` . |
430
+ | action | ` String ` | The keyword used to identify the action, capitalized. |
431
+ | slug | ` String ` | The repository owner and name, for issue referred as ` <owner>/<repo>#<issue number> ` . |
432
+ | prefix | ` String ` | The prefix used to identify the issue. |
433
+ | issue | ` String ` | The issue number. |
434
+
435
+ #### parentOf
436
+
437
+ Type: ` Array<Object> `
438
+
439
+ List of child issues and pull requests.<br >
440
+ Each action has the following properties:
441
+
442
+ | Name | Type | Description |
443
+ | --------| ----------| ---------------------------------------------------------------------------------------|
444
+ | raw | ` String ` | The raw value parsed, for example ` Parent of #1 ` . |
445
+ | action | ` String ` | The keyword used to identify the action, capitalized. |
446
+ | slug | ` String ` | The repository owner and name, for issue referred as ` <owner>/<repo>#<issue number> ` . |
447
+ | prefix | ` String ` | The prefix used to identify the issue. |
448
+ | issue | ` String ` | The issue number. |
449
+
450
+ #### childOf
451
+
452
+ Type: ` Array<Object> `
453
+
454
+ List of parent issues and pull requests.<br >
455
+ Each action has the following properties:
456
+
457
+ | Name | Type | Description |
458
+ | --------| ----------| ---------------------------------------------------------------------------------------|
459
+ | raw | ` String ` | The raw value parsed, for example ` Child of #1 ` . |
460
+ | action | ` String ` | The keyword used to identify the action, capitalized. |
461
+ | slug | ` String ` | The repository owner and name, for issue referred as ` <owner>/<repo>#<issue number> ` . |
462
+ | prefix | ` String ` | The prefix used to identify the issue. |
463
+ | issue | ` String ` | The issue number. |
464
+
358
465
#### duplicates
359
466
360
467
Type: ` Array<Object> `
@@ -364,7 +471,7 @@ Each duplicate has the following properties:
364
471
365
472
| Name | Type | Description |
366
473
| --------| ----------| ---------------------------------------------------------------------------------------|
367
- | raw | ` String ` | The raw value parsed, for example ` Fix #1` . |
474
+ | raw | ` String ` | The raw value parsed, for example ` Duplicate of #1` . |
368
475
| action | ` String ` | The keyword used to identify the duplicate, capitalized. |
369
476
| slug | ` String ` | The repository owner and name, for issue referred as ` <owner>/<repo>#<issue number> ` . |
370
477
| prefix | ` String ` | The prefix used to identify the issue. |
@@ -379,7 +486,7 @@ Each reference has the following properties:
379
486
380
487
| Name | Type | Description |
381
488
| --------| ----------| ---------------------------------------------------------------------------------------|
382
- | raw | ` String ` | The raw value parsed, for example ` Fix #1` . |
489
+ | raw | ` String ` | The raw value parsed, for example ` #1 ` . |
383
490
| slug | ` String ` | The repository owner and name, for issue referred as ` <owner>/<repo>#<issue number> ` . |
384
491
| prefix | ` String ` | The prefix used to identify the issue. |
385
492
| issue | ` String ` | The issue number. |
@@ -393,7 +500,7 @@ Each mention has the following properties:
393
500
394
501
| Name | Type | Description |
395
502
| --------| ----------| ---------------------------------------------|
396
- | raw | ` String ` | The raw value parsed, for example ` Fix #1 ` . |
503
+ | raw | ` String ` | The raw value parsed, for example ` @user ` . |
397
504
| prefix | ` String ` | The prefix used to identify the mention. |
398
505
| user | ` String ` | The user name |
399
506
0 commit comments