Skip to content

Commit

Permalink
adds changelog and loosens flow checks for test.js files
Browse files Browse the repository at this point in the history
  • Loading branch information
nsfmc committed Nov 19, 2016
1 parent 272f64e commit deada87
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
20 changes: 13 additions & 7 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@

// Add your own contribution below

### 0.6.0

* omits flow requirement for new test files
* adds support for circleci
* defines CISource properties in flow as read-only

### 0.5.0

* `danger.pr` -> `danger.github.pr`, I've also created interfaces for them - orta
* `warn`, `message`, `markdown` are all ported over to DangerJS - orta
* Shows a HTML table for Danger message - orta
* Now offers a Flow-typed definition file, it's not shipped to their repo yet, you can make it by `npm run export-flowtype` - orta
* Now offers a Flow-typed definition file, it's not shipped to their repo yet, you can make it by `npm run export-flowtype` - orta
* Started turning this into a real project by adding tests - orta

### 0.0.5-0.0.10
Expand All @@ -22,15 +28,15 @@

* Danger will post a comment on a GitHub PR with any Fails - orta

### 0.0.2
### 0.0.2

OK, first usable for others version. Only supports GitHub and Travis CI.

You can run by doing:

```sh
danger
```
```

Make sure you set a `DANGER_GITHUB_API_TOKEN` on your CI - [see the Ruby guide](http://danger.systems/guides/getting_started.html#setting-up-danger-to-run-on-your-ci) for that.

Expand All @@ -42,13 +48,13 @@ git
fail(message: string)
```

`pr` _probably_ won't be sticking around for the long run, but if you're using a `0.0.2` release, you should be OK with that. It's the full metadata of the PR, so [this JSON file](https://raw.githubusercontent.com/danger/danger/master/spec/fixtures/github_api/pr_response.json).
`pr` _probably_ won't be sticking around for the long run, but if you're using a `0.0.2` release, you should be OK with that. It's the full metadata of the PR, so [this JSON file](https://raw.githubusercontent.com/danger/danger/master/spec/fixtures/github_api/pr_response.json).
`git` currently has:

```sh
git.modified_file
git.created_files
git.deleted_files
git.deleted_files
```

which are string arrays of files.
Expand All @@ -66,10 +72,10 @@ if (!hasChangelog) {
}
```

That should do ya. I think. This doens't support babel, and I haven't explored using other modules etc, so
That should do ya. I think. This doens't support babel, and I haven't explored using other modules etc, so

./

### 0.0.1

Not usable for others, only stubs of classes etc.
Not usable for others, only stubs of classes etc.
8 changes: 5 additions & 3 deletions dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ if (!hasChangelog) {
const jsFiles = danger.git.created_files.filter(path => path.endsWith("js"))

// new js files should have `@flow` at the top
const unFlowedFiles = jsFiles.filter(filepath => {
const content = fs.readFileSync(filepath)
return !content.includes("@flow")
// but exclude tests from being flow-ey
const unFlowedFiles = jsFiles.filter(path => !path.endsWith('test.js'))
.filter(filepath => {
const content = fs.readFileSync(filepath)
return !content.includes("@flow")
})

if (unFlowedFiles.length > 0) {
Expand Down

0 comments on commit deada87

Please sign in to comment.