Skip to content

Commit

Permalink
Merge pull request #79 from danger/remove-flow
Browse files Browse the repository at this point in the history
Remove flow from CircleCI build config #trivial
  • Loading branch information
orta committed Jan 5, 2017
2 parents b7d8920 + 57a5016 commit 86b1f52
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ test:
- npm run link
- danger
post:
- npm run flow
- npm run lint
- npm test
19 changes: 10 additions & 9 deletions dangerfile.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
// import { danger, warn } from "danger"
import fs from "fs"

// Request a CHANGELOG entry
// Request a CHANGELOG entry if not declared #trivial
const hasChangelog = danger.git.modified_files.includes("changelog.md")
if (!hasChangelog) { warn("Please add a changelog entry for your changes.") }
const isTrivial = (danger.github.pr.body + danger.github.pr.title).includes("#trivial")
if (!hasChangelog && !isTrivial) {
warn("Please add a changelog entry for your changes.")

// Politely ask for their name on the entry too
const changelogDiff = danger.git.diffForFile("changelog.md")
const contributorName = danger.github.pr.user.login
if (changelogDiff && changelogDiff.indexOf(contributorName) === -1) {
warn("Please add your GitHub name to the changelog entry, so we can attribute you.")
// Politely ask for their name on the entry too
const changelogDiff = danger.git.diffForFile("changelog.md")
const contributorName = danger.github.pr.user.login
if (changelogDiff && changelogDiff.indexOf(contributorName) === -1) {
warn("Please add your GitHub name to the changelog entry, so we can attribute you.")
}
}

const jsFiles = danger.git.created_files.filter(path => path.endsWith("js"))

0 comments on commit 86b1f52

Please sign in to comment.