@shopify/danger
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@shopify/danger

Build Status License: MIT npm version npm bundle size (minified + gzip)

Danger is a static analysis tool used to automate code review by evaluating the content of a PR and reporting pass/fail status based on user-supplied rules for a repository. It is de-centralized and relies upon the APIs of a hosted git repository like GitHub.

This repo is a collection of open-source rules for DangerJS pipelines to enforce conventions such as warning if a PR is too large, if it lacks tests, etc.

Usage

Install:

yarn add @shopify/danger --dev

In your dangerfile:

// dangerfile.js
import analyze, {
  skipForBots,
  includeIssueNumber,
  includeFrontendTesting,
  includeBackendTesting,
  warnIfLargePR,
} from "@shopify/danger";

// Skip testing for bots e.g. Dependabot
skipForBots(danger)

// Require an issue number
includeIssueNumber(danger)

// fail PRs with >2 FE or BE file changes without tests
includeFrontendTesting(danger, 2);
includeBackendTesting(danger, 2);

// Warn if a PR is larger than X amount of lines
warnIfLargePR(danger, 200)

Changelog

See the GitHub release history.

Contributing

See CONTRIBUTING.md.

Readme

Keywords

Package Sidebar

Install

npm i @shopify/danger

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

24.3 kB

Total Files

23

Last publish

Collaborators

  • jaimie.rockburn
  • blittle
  • shopify-admin
  • maryharte
  • crisfmb
  • pmoloney89
  • netlohan
  • st999999
  • justin-irl
  • megswim
  • wcandillon
  • nathanpjf
  • shopify-dep
  • goodforonefare
  • lemonmade
  • vsumner
  • wizardlyhel
  • antoine.grant
  • tsov
  • andyw8-shopify
  • henrytao
  • hannachen
  • vividviolet
  • bpscott