From 0023fe6dc814db33deb62abc9acf2ddcaf7e1d94 Mon Sep 17 00:00:00 2001 From: Mike Sherov Date: Fri, 22 Apr 2016 11:37:51 -0400 Subject: [PATCH] =?UTF-8?q?Build:=20Add=20=E2=80=9Cchore=E2=80=9D=20to=20c?= =?UTF-8?q?ommit=20tags=20(fixes=20#5880)=20(#5929)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile.js | 3 ++- templates/blogpost.md.ejs | 7 +++++ templates/pr-create.md.ejs | 2 +- tests/templates/pr-create.md.ejs.js | 40 +++++++++++++++-------------- 4 files changed, 31 insertions(+), 21 deletions(-) diff --git a/Makefile.js b/Makefile.js index 25ecb3159ddf..0a90be416b24 100644 --- a/Makefile.js +++ b/Makefile.js @@ -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 @@ -914,6 +914,7 @@ target.checkGitCommit = function() { " 'Build:'", " 'New:'", " 'Upgrade:'", + " 'Chore:'", " Please refer to the contribution guidelines for more details."].join("\n")); failed = true; } diff --git a/templates/blogpost.md.ejs b/templates/blogpost.md.ejs index 755f49b32a03..045e755ce650 100644 --- a/templates/blogpost.md.ejs +++ b/templates/blogpost.md.ejs @@ -71,3 +71,10 @@ function outputList(items) { <% outputList(changelog.build); %> <% } %> + +<% if (typeof changelog.chore !== "undefined") { %> +## Chores + +<% outputList(changelog.chore); %> + +<% } %> diff --git a/templates/pr-create.md.ejs b/templates/pr-create.md.ejs index 80c05725e949..b706b069b911 100644 --- a/templates/pr-create.md.ejs +++ b/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) { diff --git a/tests/templates/pr-create.md.ejs.js b/tests/templates/pr-create.md.ejs.js index 3667629e420f..1221b6c1ae61 100644 --- a/tests/templates/pr-create.md.ejs.js +++ b/tests/templates/pr-create.md.ejs.js @@ -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() {