explaingit

danger/danger

5,666RubyAudience · developerComplexity · 3/5LicenseSetup · moderate

TLDR

Danger automates code review checklists by running your team's written rules during CI and posting the results as pull request comments, so reviewers stop repeating the same reminders on every PR.

Mindmap

mindmap
  root((Danger))
    What it does
      Automate PR checklists
      Post review comments
      Enforce team rules
    Integrations
      GitHub
      GitLab
      Bitbucket
      CircleCI
    Rules
      Written in Ruby
      Dangerfile format
      Plugin system
    Audience
      Dev teams
      Open source projects
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Automatically remind contributors to update the CHANGELOG on every pull request without a human reviewer having to say it

USE CASE 2

Enforce PR description requirements like Jira ticket links by writing a Ruby rule that runs on every CI build

USE CASE 3

Flag specific files or patterns that need extra review attention and post results directly into the PR thread

USE CASE 4

Share reusable rule sets across multiple repositories using Danger's plugin packaging system

Tech stack

RubyCircleCIGitHubGitLabBitbucket

Getting it running

Difficulty · moderate Time to first run · 30min

Most end-user setup documentation is on the external danger.systems website, not inside this repository.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

Danger is a tool that runs automatically during your team's code review process and handles the repetitive checklist items that humans keep forgetting to mention. Instead of someone always having to comment "you forgot to update the CHANGELOG" or "this pull request doesn't have a Jira ticket link," you write those rules once and Danger enforces them every time, automatically. The tool runs as part of your existing automated build process. When a pull request or merge request is opened, Danger checks whatever rules your team has written and posts the results as a comment on the review. This works with GitHub, GitLab, and Bitbucket, and integrates with common build services like CircleCI. The rules are written in a Ruby-based scripting format. Teams use them to require CHANGELOGs to be updated, verify that PR descriptions include certain information, flag files that need extra attention, surface build artifacts, or catch patterns the team has agreed to avoid. There is a plugin system so that common rules can be packaged and shared across teams or projects. The README itself notes that most end-user documentation lives on a separate website at danger.systems rather than in the repository. The GitHub repository is primarily for people who want to contribute to Danger's own development. If you want to set Danger up for your project, the guides on that external site cover the getting-started steps. The project is open source under the MIT license and is written in Ruby. It has been actively developed for several years and has an established contributor community.

Copy-paste prompts

Prompt 1
Write a Dangerfile in Ruby that fails the check if a pull request does not include an entry in CHANGELOG.md
Prompt 2
How do I set up Danger to run on CircleCI and post automated review comments on GitHub pull requests, walk me through the configuration
Prompt 3
Show me how to write a Danger rule that warns when a PR touches more than 10 files and has no PR description
Prompt 4
How do I create and publish a Danger plugin in Ruby so my team can reuse the same rules across multiple repositories
Prompt 5
What is the difference between a Danger warning and a Danger failure, and when should I use each one?
Open on GitHub → Explain another repo

← danger on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.