Browse Source

Enable Var.CI

pull/706/head
Jad Bitar 9 years ago
parent
commit
b90fcf26ae
1 changed files with 65 additions and 0 deletions
  1. 65
    0
      .varci.yml

+ 65
- 0
.varci.yml View File

@@ -0,0 +1,65 @@
1
+ruleset:
2
+
3
+  body_link:
4
+    name: "Pull requests that add links should also include them in the body"
5
+    events: [ pull_request ]
6
+    when:
7
+      - action = "opened"
8
+      - files = ["README.md"]
9
+      - deletions = 0
10
+      - not (body_links.added contains diff_links.added)
11
+    comment: |
12
+      This pull request adds the following suggestion:
13
+
14
+      {{ diff.added.0 }}
15
+
16
+  broken_link:
17
+    name: "Pull request diff contains broken links"
18
+    events: [ pull_request ]
19
+    when:
20
+      - action = "opened"
21
+      - count(diff_links.broken) > 0
22
+    comment: >
23
+      @{{ user.login }}, at least one of the links in the pull request diff was
24
+      reported as broken:
25
+
26
+      - {{ diff_links.broken.0 }}
27
+
28
+  missing_link:
29
+    name: "Suggestions should include a link"
30
+    events: [ pull_request ]
31
+    when:
32
+      - action = "opened"
33
+      - files = ["README.md"]
34
+      - deletions = 0
35
+      - additions = 1
36
+      - count(grep("/^\* /", diff.added)) = 1
37
+      - count(diff_links.added) != 1
38
+    comment: >
39
+      @{{ user.login }}, it looks like you have added a new suggestion to the
40
+      `README.md` file but haven't linked to the project. Please update the
41
+      `README.md` to also link to the project, thanks!
42
+
43
+  multiple_additions:
44
+    name: "Pull request should only suggest one addition at a time"
45
+    events: [ pull_request ]
46
+    comment: |
47
+      @{{ user.login }}, it looks like you are trying to add multiple suggestions in a single pull request.
48
+
49
+      If so, please split these into multiple pull requests so each item's inclusion in the list can be discussed separately.
50
+    when:
51
+      - action = "opened"
52
+      - files = ["README.md"]
53
+      - deletions = 0
54
+      - count(grep("/^\* /", diff.added)) > 1
55
+
56
+  needs_explanation:
57
+    name: 'Pull request bodies should have a detailed explanation'
58
+    events: [ pull_request ]
59
+    label: 'needs: explanation'
60
+    when:
61
+      - action = "opened"
62
+      - length(body) < 25
63
+    message: >
64
+      @{{ user.login }}, please update the pull request body with a description
65
+      of what you are adding or changing (of at least 25 characters).

Loading…
Cancel
Save