New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

danger-plugin-pull-request

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

danger-plugin-pull-request

A Danger plugin to verify the completion of a pull request

latest
Source
npmnpm
Version
1.1.4
Version published
Maintainers
1
Created
Source

danger-plugin-pull-request

Build Status npm version semantic-release

A Danger plugin to verify the completion of a pull request. Currently support GitHub and GitLab.

Usage

Install:

yarn add danger-plugin-pull-request --dev

At a glance:

dangerfile.js

import * as pullRequest from 'danger-plugin-pull-request'

pullRequest.checkAssignees();
pullRequest.checkDescription(1000);
pullRequest.checkTitle(/^\[[A-Za-z]+-\d+\]/);
pullRequest.checkPRSize(50);
pullRequest.checkMergeSquashChecked(); // GitLab only
pullRequest.checkDeleteSourceBranchChecked(); // GitLab only

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, patternMessage, [reporter])

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

Arguments:

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

checkPRSize(maxSize, [reporter])

Checks if a pull request is too big.

Arguments:

  • maxSize (Number): The maximum changed files count 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

checkMergeSquashChecked([reporter])

Checks if merge squash checked. (GitLab only)

Arguments:

  • [reporter] (Function): The reporter (message, warn or fail) to call if the pull request's description is too short.
    • Default value: fail

checkDeleteSourceBranchChecked([reporter])

Checks if delete source branch checked. (GitLab only)

Arguments:

  • [reporter] (Function): The reporter (message, warn or fail) to call if the pull request's description is too short.
    • Default value: fail

Changelog

See the GitHub release history.

Contributing

See CONTRIBUTING.md.

Keywords

danger

FAQs

Package last updated on 19 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts