Skip to content

Commit

Permalink
Correct some examples in node-app
Browse files Browse the repository at this point in the history
* need to use github property to access the pr
* the length check does not need a negation
  • Loading branch information
clintam committed Jun 16, 2017
1 parent fcea3b4 commit c8cb9f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.md
Expand Up @@ -3,6 +3,7 @@
### Master

- Use HTTP for the GitHub status check target URL - macklinu
- Correct some examples in node-app - clintam

### 0.21.0

Expand Down
6 changes: 3 additions & 3 deletions docs/tutorials/node-app.html.md
Expand Up @@ -20,7 +20,7 @@ We use [a slack bot][no-slacking] to let people know when they've been assigned
```js
import { danger, fail, warn } from "danger"

if (!danger.pr.assignee) {
if (!danger.github.pr.assignee) {
fail("This pull request needs an assignee, and optionally include any reviewers.")
}
```
Expand All @@ -32,7 +32,7 @@ We can make a small improvement to this rule, by allowing someone to declare tha
```js
import { danger, fail, warn } from "danger"

if (!danger.pr.assignee) {
if (!danger.github.pr.assignee) {
const method = pr.title.includes("WIP") ? warn : fail
method("This pull request needs an assignee, and optionally include any reviewers.")
}
Expand All @@ -45,7 +45,7 @@ Using a function as a variable we can determine whether to fail, or warn based o
In a similar vein, we also want to encourage pull requests as a form of documentation. We can help push people in this direction by not allowing the body of a pull request to be less than a few characters long.

```js
if (!danger.pr.body.length < 10) {
if (danger.github.pr.body.length < 10) {
fail("This pull request needs an description.")
}
```
Expand Down

0 comments on commit c8cb9f4

Please sign in to comment.