-
-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from danger/tests_ok
Support warning, messages and arbitrary markdown in the DSL
- Loading branch information
Showing
26 changed files
with
404 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ distribution | |
[include] | ||
|
||
[libs] | ||
interfaces/ | ||
flow-typed/ | ||
|
||
[options] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// @flow | ||
|
||
import { danger, fail, warn } from "danger" | ||
const fs = require("fs") | ||
|
||
// warn on changes in Package.json and not in shrinkwrap | ||
const hasChangelog = danger.git.modified_files.includes("changelog.md") | ||
if (!hasChangelog) { | ||
fail("No Changelog changes!") | ||
} | ||
|
||
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") | ||
}) | ||
|
||
if (unFlowedFiles.length > 0) { | ||
warn(`These new JS files do not have Flow enabled: ${unFlowedFiles.join(", ")}`) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// @flow | ||
export type MarkdownString = string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// @flow | ||
"use strict" | ||
|
||
import type { GitDSL } from "../dsl/GitDSL" | ||
import type { CISource } from "../ci_source/ci_source" | ||
|
||
export default class FakePlatform { | ||
name: string | ||
ciSource: CISource | ||
|
||
constructor() { | ||
this.name = "Fake" | ||
} | ||
|
||
async getReviewInfo(): Promise<any> { | ||
|
||
} | ||
|
||
async getReviewDiff(): Promise<GitDSL> { | ||
return { | ||
modified_files: [], | ||
created_files: [], | ||
deleted_files: [] | ||
} | ||
} | ||
|
||
async updateOrCreateComment(newComment: string): Promise<bool> { | ||
return true | ||
} | ||
|
||
async createComment(comment: string): Promise<any> { | ||
return true | ||
} | ||
|
||
async deleteMainComment(): Promise<bool> { | ||
return true | ||
} | ||
|
||
async editMainComment(comment: string): Promise<bool> { | ||
return true | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.