From b90fcf26ae1c7731fa786bee3361437b0877ca0e Mon Sep 17 00:00:00 2001 From: Jad Bitar Date: Thu, 6 Oct 2016 16:17:10 -0400 Subject: [PATCH] Enable Var.CI --- .varci.yml | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .varci.yml diff --git a/.varci.yml b/.varci.yml new file mode 100644 index 0000000..c05a4f9 --- /dev/null +++ b/.varci.yml @@ -0,0 +1,65 @@ +ruleset: + + body_link: + name: "Pull requests that add links should also include them in the body" + events: [ pull_request ] + when: + - action = "opened" + - files = ["README.md"] + - deletions = 0 + - not (body_links.added contains diff_links.added) + comment: | + This pull request adds the following suggestion: + + {{ diff.added.0 }} + + broken_link: + name: "Pull request diff contains broken links" + events: [ pull_request ] + when: + - action = "opened" + - count(diff_links.broken) > 0 + comment: > + @{{ user.login }}, at least one of the links in the pull request diff was + reported as broken: + + - {{ diff_links.broken.0 }} + + missing_link: + name: "Suggestions should include a link" + events: [ pull_request ] + when: + - action = "opened" + - files = ["README.md"] + - deletions = 0 + - additions = 1 + - count(grep("/^\* /", diff.added)) = 1 + - count(diff_links.added) != 1 + comment: > + @{{ user.login }}, it looks like you have added a new suggestion to the + `README.md` file but haven't linked to the project. Please update the + `README.md` to also link to the project, thanks! + + multiple_additions: + name: "Pull request should only suggest one addition at a time" + events: [ pull_request ] + comment: | + @{{ user.login }}, it looks like you are trying to add multiple suggestions in a single pull request. + + If so, please split these into multiple pull requests so each item's inclusion in the list can be discussed separately. + when: + - action = "opened" + - files = ["README.md"] + - deletions = 0 + - count(grep("/^\* /", diff.added)) > 1 + + needs_explanation: + name: 'Pull request bodies should have a detailed explanation' + events: [ pull_request ] + label: 'needs: explanation' + when: + - action = "opened" + - length(body) < 25 + message: > + @{{ user.login }}, please update the pull request body with a description + of what you are adding or changing (of at least 25 characters).