Skip to content

Commit

Permalink
Build: Add “chore” to commit tags (fixes eslint#5880)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesherov committed Apr 22, 2016
1 parent 495c6c4 commit 63fb937
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 21 deletions.
3 changes: 2 additions & 1 deletion Makefile.js
Expand Up @@ -70,7 +70,7 @@ var NODE = "node ", // intentional extra space
PERF_MULTIFILES_TARGETS = PERF_MULTIFILES_TARGET_DIR + path.sep + "{lib,tests" + path.sep + "lib}" + path.sep + "**" + path.sep + "*.js",

// Regex
TAG_REGEX = /^(?:Fix|Update|Breaking|Docs|Build|New|Upgrade):/,
TAG_REGEX = /^(?:Breaking|Build|Chore|Docs|Fix|New|Update|Upgrade):/,
ISSUE_REGEX = /\((?:fixes|refs) #\d+(?:.*(?:fixes|refs) #\d+)*\)$/,

// Settings
Expand Down Expand Up @@ -914,6 +914,7 @@ target.checkGitCommit = function() {
" 'Build:'",
" 'New:'",
" 'Upgrade:'",
" 'Chore:'",
" Please refer to the contribution guidelines for more details."].join("\n"));
failed = true;
}
Expand Down
7 changes: 7 additions & 0 deletions templates/blogpost.md.ejs
Expand Up @@ -71,3 +71,10 @@ function outputList(items) {
<% outputList(changelog.build); %>
<% } %>

<% if (typeof changelog.chore !== "undefined") { %>
## Chores
<% outputList(changelog.chore); %>
<% } %>
2 changes: 1 addition & 1 deletion templates/pr-create.md.ejs
@@ -1,6 +1,6 @@
<%
var FLAG_PATTERN = /^(Fix|Update|New|Breaking|Build|Docs|Upgrade):/,
var FLAG_PATTERN = /^(Breaking|Build|Chore|Docs|Fix|New|Update|Upgrade):/,
ISSUE_REF_PATTERN = /\((fixes|refs) #\d+.*?\)$/;
function isValidCommitFlag(log) {
Expand Down
40 changes: 21 additions & 19 deletions tests/templates/pr-create.md.ejs.js
Expand Up @@ -127,28 +127,30 @@ describe("pr-create.md.ejs", function() {
assert.ok(result.indexOf("require an issue") === -1);
});

it("should not mention missing issue or length check when there's one fix commit", function() {
var result = ejs.render(TEMPLATE_TEXT, {
payload: {
sender: {
login: "nzakas"
["Breaking", "Build", "Chore", "Docs", "Fix", "New", "Update", "Upgrade"].forEach(function(type) {
it("should not mention missing issue or length check when there's one " + type + " commit", function() {
var result = ejs.render(TEMPLATE_TEXT, {
payload: {
sender: {
login: "nzakas"
},
commits: 1
},
commits: 1
},
meta: {
cla: true,
commits: [
{
commit: {
message: "Fix: Foo bar (fixes #1234)\nSome really long string. abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz"
meta: {
cla: true,
commits: [
{
commit: {
message: type + ": Foo bar (fixes #1234)\nSome really long string. abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz abcdefghijklmnopqrstuvwxyz"
}
}
}
]
}
});
]
}
});

assert.equal(result.trim(), "LGTM");
assert.ok(result.indexOf("require an issue") === -1);
assert.equal(result.trim(), "LGTM");
assert.ok(result.indexOf("require an issue") === -1);
});
});

it("should mention missing issue when there's a missing closing paren", function() {
Expand Down

0 comments on commit 63fb937

Please sign in to comment.