Created by: camacho
This PR adds in Danger to help with cultural rules.
What is Danger?
Danger runs during your CI process, and gives teams the chance to automate common code review chores.
This provides another logical step in your build, through this Danger can help lint your rote tasks in daily code review.
You can use Danger to codify your teams norms. Leaving humans to think about harder problems.
She does this by leaving messages inside your PRs based on rules that you create with the Ruby scripting language.
Over time, as rules are adhered to, the message is amended to reflect the current state of the code review.
What can danger do?
I borrowed some of the cultural rules from Jest's dangerfile, but I believe there are probably a handful of additional rules (like making sure a PR is tagged with a label) that would be helpful. Danger does not enforce any rules, it just provides a mechanism to communicate information via the PR, as well as data about the PR and the files affected (via git).
Some examples of the types of rules Danger can help with:
- Ensure new files follow a naming convention
- Ensure new files have
@flow
turned on - Ensure new JS files have corresponding new test files
- Ensure PR messages follow a format or provide certain information
- Ensure an individual is assigned to review the PR
- Ensure the PR title follows a format
- Ensure the changelog is updated
- Ensure
yarn.lock
is updated whenpackage.json
is updated
To Do:
-
Add danger npm -
Add dangerfile -
Add DANGER_GITHUB_API_TOKEN
env var to CI -
Add npm run danger
task to be run on CI
cc/ @orta