Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

danger

Package Overview
Dependencies
Maintainers
0
Versions
320
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

danger

Unit tests for Team Culture

  • 12.3.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
564K
increased by13.27%
Maintainers
0
Weekly downloads
 
Created

What is danger?

Danger is a tool that helps automate code review chores. It allows you to create rules that can be enforced during the code review process, ensuring that certain standards and practices are followed.

What are danger's main functionalities?

Automate Code Review

This feature allows you to automate code review tasks by defining rules that can fail or warn if certain conditions are not met. For example, you can fail a pull request if it does not have a description or warn if it does not have any labels.

danger({
  fail: 'This PR does not have a description.',
  warn: 'This PR does not have any labels.'
});

Check for Changelog Updates

This feature checks if the changelog has been updated in the pull request. If not, it can warn the user to add a changelog entry for their changes.

if (!danger.git.modified_files.includes('CHANGELOG.md')) {
  warn('Please add a changelog entry for your changes.');
}

Enforce PR Size Limits

This feature allows you to enforce size limits on pull requests. If a pull request exceeds a certain number of additions and deletions, it can warn the user to consider breaking it down into smaller PRs.

const bigPRThreshold = 500;
if (danger.github.pr.additions + danger.github.pr.deletions > bigPRThreshold) {
  warn('This PR is too large. Consider breaking it down into smaller PRs.');
}

Other packages similar to danger

Keywords

FAQs

Package last updated on 20 Jun 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc