-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommit.ts
127 lines (107 loc) · 2.25 KB
/
commit.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/**
* @file Interfaces - Commit
* @module commitlint-config/interfaces/Commit
*/
import type { Scope, Type } from '#src/enums'
import type {
LiteralUnion,
Nullable,
OneOrMany
} from '@flex-development/tutils'
import type Note from './note'
import type Reference from './reference'
import type Revert from './revert'
/**
* Object representing a parsed commit.
*/
interface Commit {
[field: string]:
| Commit
| Note[]
| Nullable<OneOrMany<string>>
| Reference[]
| Revert
/**
* Commit body text.
*
* @see https://commitlint.js.org/#/concepts-commit-conventions
*/
body: Nullable<string>
/**
* Breaking change indicator.
*/
breaking: Nullable<'!'>
/**
* Commit date in ISO 8601-like format (`%ci`).
*
* @see https://git-scm.com/docs/pretty-formats/2.21.0
*/
committerDate: string
/**
* Commit footer text.
*
* @see https://commitlint.js.org/#/concepts-commit-conventions
*/
footer: Nullable<string>
/**
* Tags associated with commit.
*/
gitTags: string
/**
* Commit SHA.
*/
hash: string
/**
* Commit {@linkcode type}, {@linkcode scope}, {@linkcode breaking} change
* indicator (if any), and {@linkcode subject}.
*/
header: string
/**
* Users and/or organizations mentioned in commit.
*/
mentions: string[]
/**
* Merge commit data.
*/
merge: null
/**
* Breaking change notes.
*/
notes: Note[]
/**
* Pull request number if commit {@linkcode subject} includes pull request
* reference.
*/
pr: Nullable<string>
/**
* Reference actions parsed from commit.
*/
references: Reference[]
/**
* Reverted commit metadata if {@linkcode type} is {@linkcode Type.REVERT}.
*/
revert: Nullable<Revert>
/**
* Commit scope.
*
* @see https://commitlint.js.org/#/concepts-commit-conventions
*/
scope: Nullable<LiteralUnion<Scope, string>>
/**
* Abbreviated commit SHA.
*/
shortHash: Nullable<string>
/**
* Commit subject.
*
* @see https://commitlint.js.org/#/concepts-commit-conventions
*/
subject: string
/**
* Commit type.
*
* @see https://commitlint.js.org/#/concepts-commit-conventions
*/
type: LiteralUnion<Type, string>
}
export type { Commit as default }