Skip to content

Commit

Permalink
Merged by Peril
Browse files Browse the repository at this point in the history
Adds checks for nulls in the modified files
  • Loading branch information
peril-staging[bot] authored Feb 2, 2019
2 parents e56e015 + 9746651 commit e1ea3dc
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
13 changes: 12 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,16 @@
},
"editor.formatOnSave": true,
"debug.node.autoAttach": "on",
"cSpell.words": ["APIPR", "BITBUCKETSERVER", "Commenter", "JSONDSL", "PRDSL", "bitbucket", "jsome", "repo's"]
"cSpell.words": [
"APIPR",
"BITBUCKETSERVER",
"Commenter",
"Filepaths",
"JSONDSL",
"PRDSL",
"bitbucket",
"jsome",
"keypaths",
"repo's"
]
}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

- Remove dead links to example danger files. - [@stevemoser][]
- Allow danger-pr to work also on Bitbucket Server - [@f-meloni][]
- Fix for nulls in modified_files - [@orta][]

# 7.0.4

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ yarn lint
The fixers for both tslint and prettier will be applied when you commit, and on a push your code will be verified that
it compiles.

You can run your dev copy of danger against a PR by running:

```sh
yarn build; node --inspect distribution/source/commands/danger-pr.js https://github.com/danger/danger-js/pull/817
```

### How does Danger JS work?

Check the [architecture doc](https://github.com/danger/danger-js/blob/master/docs/architecture.md).
Expand Down
3 changes: 2 additions & 1 deletion source/platforms/git/diffToGitJSONDSL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export const diffToGitJSONDSL = (diff: string, commits: GitCommit[]): GitJSONDSL
const modifiedDiffs = fileDiffs.filter((diff: any) => !includes(addedDiffs, diff) && !includes(removedDiffs, diff))

return {
modified_files: modifiedDiffs.map(d => d.to),
// Work around for danger/danger-js#807
modified_files: modifiedDiffs.map(d => d.to || (d.from && d.from.split(" b/")[0])),
created_files: addedDiffs.map(d => d.to),
deleted_files: removedDiffs.map(d => d.from),
commits: commits,
Expand Down

0 comments on commit e1ea3dc

Please sign in to comment.