Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including danger-plugin-complete-pr with all npm packages installed. Try it out:

var dangerPluginCompletePr = require("danger-plugin-complete-pr")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

danger-plugin-complete-pr v1.0.1

A Danger plugin to verify the completion of a pull request.

danger-plugin-complete-pr

Build Status npm version semantic-release

A Danger plugin to verify the completion of a pull request on GitHub.

Usage

Install:

yarn add danger-plugin-complete-pr --dev

At a glance:

dangerfile.js

import * as completePr from 'danger-plugin-complete-pr'

completePr.checkAssignees();
completePr.checkDescription(10);
completePr.checkTitle(/^\[[A-Za-z]+-\d+\]/);

API

checkAssignees([reporter])

Checks is the current pull request has any assignees.

Arguments:

  • [reporter] (Function): The reporter (message, warn or fail) to call if the pull request has no assignees.
    • Default value: fail

checkDescription(minimumLength, [reporter])

Checks if the description of the pull request is long enough.

Arguments:

  • minimumLength (Number): The minimum length for a description to be valid.
  • [reporter] (Function): The reporter (message, warn or fail) to call if the pull request's description is too short.
    • Default value: fail

checkTitle(pattern, [reporter])

Checks if the title of the pull request matches a given pattern.

Arguments:

  • pattern (RegExp): The pattern to test the title with.
  • [reporter] (Function): The reporter (message, warn or fail) to call if the pull request's title is invalid.
    • Default value: fail

Changelog

See the GitHub release history.

Contributing

See CONTRIBUTING.md.

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free