@arquivei/danger

Danger rules designed by Arquivei

Usage no npm install needed!

<script type="module">
  import arquiveiDanger from 'https://cdn.skypack.dev/@arquivei/danger';
</script>

README

Arquivei - Danger

Danger checks for all of arquivei projects. Feel free to use these conventions. :-)

Usage:

This usage is exemplified for bitbucket pipelines, for more information about others pipelines access: DangerJS.

With yarn:

  • Install @arquivei/danger
yarn add @arquivei/danger --dev
  • Create dangerfile.js on root of project
import arquiveiDanger from '@arquivei/danger'

arquiveiDanger()
  • Add danger on validate step of bitbucket-pipelines.yml
script:
    - yarn
    - yarn danger ci
    - [...]
  • Install danger as dev dependencies
yarn add danger -D

With npm:

  • Install @arquivei/danger
npm install @arquivei/danger --dev
  • Create dangerfile.js on root of project
import arquiveiDanger from '@arquivei/danger'

arquiveiDanger()
  • Add danger script package.json
"scripts": {
    "[...]"
    "danger": "danger ci"
}
  • Add danger on validate step of bitbucket-pipelines.yml
script:
    - npm install
    - npm run danger
    - [...]
  • Install danger as dev dependencies
npm install danger -D

Repository variables

To run DangerJS in the Bitbucket pipeline it is necessary to configure two environment variables:

  • DANGER_BITBUCKETCLOUD_OAUTH_KEY
  • DANGER_BITBUCKETCLOUD_OAUTH_SECRET

The value of the variables is confidential for each company.

Local Validate

You can validate on your local if danger is working as expected:

//yarn
yarn danger pr <pr-link>

//npm
npm run danger pr <pr-link>.

DangerJS

Danger runs during your CI process, and gives teams the chance to automate common code review chores.

More information about DangerJS: https://danger.systems/js/