Danger.js is a tool that we use to automate certain aspects of our code review process.
Checks that we automate include:
package.json
has been updated so that the package can be successfully published to NPMCHANGELOG
so that the history is kept up to date.We automate Danger.js checks through Travis once a package is moved from being private to public.
To setup Danger.js to run checks automatically on your repositories PRs, follow these steps:
yarn add danger --dev
in the terminal to add Danger.js as a development dependency..travis.yml
in your project root and that it has the script setting – yarn danger ci
– such as it's shown in generator-fozzie.dangerfile.js
to the root of your repository and make sure it matches the one in the generator..babelrc
file in the root of your project and that it contains at least an empty object {}
. This is because of an issue with babel-jest
which needs to be worked around for now.fozzie-bot
(our Github bot account) to post on your project PRs on behalf of Danger.js.
DANGER_GITHUB_API_TOKEN = {FOZZIEBOT_API_TOKEN}
{FOZZIEBOT_API_TOKEN}
can simply be copied from the Travis build settings that already has this token set (i.e. any Fozzie package already setup on Travis).On
– this is so that the module can also run the checks on PRs submitted from a fork of your Github repo.