Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Thornton <jacobthornton@gmail.com>2012-07-22 23:57:39 +0400
committerJacob Thornton <jacobthornton@gmail.com>2012-07-22 23:57:39 +0400
commit6c2fa9430c04b666ae5f490312be29116a7782d2 (patch)
treeb6afb192aa90a676a398af4c703778ecc3e92967 /.issue-guidelines.js
parentb9105b98f9ee5f15d5b18bccf277344683d4a6db (diff)
add haunt w/ issue guideline spec
Diffstat (limited to '.issue-guidelines.js')
-rw-r--r--.issue-guidelines.js85
1 files changed, 85 insertions, 0 deletions
diff --git a/.issue-guidelines.js b/.issue-guidelines.js
new file mode 100644
index 0000000000..c2de45379f
--- /dev/null
+++ b/.issue-guidelines.js
@@ -0,0 +1,85 @@
+/* ==========================================================
+ * issue-guidelines.js
+ * http://twitter.github.com/bootstrap/javascript.html#alerts
+ * ==========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+var assert = require('assert')
+
+module.exports = {
+
+ 'pull-requests': {
+
+ 'should always be made against -wip branches': function (pull) {
+ assert.ok(/\-wip$/.test(pull.base.label))
+ },
+
+ 'should always be made from feature branches': function (pull) {
+ assert.ok(pull.head.label != 'master')
+ },
+
+ 'should always include a unit test if changing js files': function (pull) {
+ var hasJS = false
+ var hasTests = false
+
+ pull.files.forEach(function (file) {
+ if (/^js\/[^./]+.js/.test(file.filename)) hasJS = true
+ if (/^js\/test\/unit\/[^.]+.js/.test(file.filename)) hasTests = true
+ })
+
+ assert.ok(!hasJS || hasJS && hasTests)
+ },
+
+ 'after': function (pull) {
+ if (pull.reporter.stats.failures) {
+ pull.reportFailures(pull.close.bind(pull))
+ }
+ }
+
+ },
+
+ 'issues': {
+
+ 'before': function (issue) {
+ var plus = {}
+ var labels = issue.labels.map(function (label) { return label.name });
+
+ if (~labels.indexOf('popular')) return
+
+ issue.comments.forEach(function (comment) {
+ if (/\+1/.test(comment.body)) plus[comment.user.login] = true
+ })
+
+ if (Object.keys(plus).length > 5) {
+ issue.tag('popular')
+ issue.comment('Tagging this issue as popular, please stop commenting on this issue with +1. thanks!')
+ }
+ },
+
+ 'should include a jsfiddle/jsbin illustrating the problem if tagged with js but not a feature': function (issue) {
+ var labels = issue.labels.map(function (label) { return label.name });
+ if (~labels.indexOf('js') && !~labels.indexOf('feature')) assert.ok(/(jsfiddle|jsbin)/.test(issue.body))
+ },
+
+ 'after': function (issue) {
+ if (issue.reporter.stats.failures) {
+ issue.reportFailures(issue.close.bind(issue))
+ }
+ }
+
+ }
+
+} \ No newline at end of file