forked from AdamOswald/tes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.githint.json
130 lines (129 loc) · 5.14 KB
/
.githint.json
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
128
129
130
{
"options": {
"detectPull": true
},
"checks": {
".gitignore": {
"script": "!!(tree.tree.find(t => t.path === '.gitignore'))",
"message": [
"The repository must contain a .gitignore file"
]
},
"CHANGELOG": {
"script": "!!(tree.tree.find(t => t.path === 'CHANGELOG' || t.path === 'CHANGELOG.md'))",
"message": [
"The repository must contain a CHANGELOG(.md) file"
]
},
"CODE_OF_CONDUCT": {
"script": "!!(tree.tree.find(t => t.path === 'CODE_OF_CONDUCT.md'))",
"message": [
"The repository must contain a CODE_OF_CONDUCT.md file"
]
},
"CONTRIBUTING": {
"script": "!!(tree.tree.find(t => t.path === 'CONTRIBUTING.md'))",
"message": [
"The repository must contain a CONTRIBUTING.md file"
]
},
"LICENSE": {
"script": "!!(tree.tree.find(t => t.path === 'LICENSE'))",
"message": [
"The repository must contain a LICENSE file"
]
},
"README": {
"script": "!!(tree.tree.find(t => t.path === 'README.md'))",
"message": [
"Help people interested in this repository understand your project by adding a README."
]
},
"Branch Name": {
"script": "/^((ft-)|(ch-)|(bg-))[a-z0-9\\-]+$/.test(branch.name)",
"message": [
"Branches created should be named using the following format:",
"{story type}-{2-3 word summary}",
"",
"{story type} - Indicates the context of the branch and should be one of:",
" * bg = Bug",
" * ch = Chore",
" * ft = Feature",
"",
],
"message": [
"Started, finished, fixed or delivered stories should be listed in the footer",
"prefixed with 'Finishes', 'Fixes' , or 'Delivers' keyword like this:",
"",
"[Finishes #1234567]"
]
},
"PR Title": {
"script": "/^[\\w\\s-().]+$/.test(pull.title)",
"message": [
"The PR title should be in the following format:",
"`{story description}`",
"",
"Example of a valid PR title:",
"",
"Build out REST Endpoint for Resources (CRUD)"
]
},
"PR Description": {
"script": [
"const body = pull.body",
"return body.indexOf('#### What does this PR do?') > -1",
" && body.indexOf('#### Description of task to be completed?') > -1",
" && body.indexOf('#### How should this be manually tested?') > -1",
" && body.indexOf('#### Any background context you want to provide?') > -1",
" && body.indexOf('#### What are the relevant pivotal tracker stories?') > -1",
" && body.indexOf('#### Screenshots (if appropriate)') > -1",
" && body.indexOf('#### Questions') > -1"
],
"message": [
"The description of the PR should contain the following headings",
"and corresponding content in Markdown format.",
"",
"`#### What does this PR do?`",
"`#### Description of task to be completed?`",
"`#### How should this be manually tested?`",
"`#### Any background context you want to provide?`",
"`#### What are the relevant pivotal tracker stories?`",
"`#### Screenshots (if appropriate)`",
"`#### Questions:`"
]
},
"PR 'ready' Label": {
"script": "pull.labels.length === 1 && !!(pull.labels.find(l => l.name === 'ready'))",
"message": "PR must have label 'ready'"
}
}
}
{
"options": {
"detectPull": true
},
"checks": {
"This check always passes": "true",
"A commit cannot touch more than 1 file": "commit.files.length < 2",
"The message of a head commit must match the name of the branch": [
"const commitMessage = commit.commit.message;",
"const branchName = branch.name;",
"return commitMessage === branchName;"
],
"Branch name must start with 'ft-' or 'ch-' or 'bug-' followed by stuff": {
"script": "/^((ft-)|(ch-)|(bug-))[a-z0-9\-]+$/.test(branch.name)",
"message": "The name of this branch doesn't meet the specified criteria"
},
"Only Franklin can edit the .githint.json file": {
"script": [
"let file = commit.files[0].filename",
"let editor = commit.commit.author.name",
"return (file != '.githint.json' || editor == 'Chieze Franklin');"
],
"message": "The .githint.json file shouldn't be touched; Only Franklin can edit the file."
},
"Repo must contain CONTRIBUTING.md": "tree.tree.filter(t => t.path === 'CONTRIBUTING.md').length === 1",
"A PR cannot touch more than 1 file": "pull.changed_files < 2"
}
}