danger /danger

🚫 Stop saying "you forgot to …" in code review (in Ruby)

★ 5,696⑂ 495👁 44⑃ 927● 619▤ 131
RubyMITCreated 2015-09-29danger.systems
下载:9.6.29.6.2 ↓9.6.22026-11-09
+0
日增长
5,696
stars
495
forks
44
watchers
927
prs
619
issues
131
releases

README

Danger :no_entry_sign:





Formalize your Pull Request etiquette.

-------


    What is Danger? •
    Vision •
    Helping Out •
    Plugin Development


-------

 What is Danger?

Danger runs during your CI process, and gives teams the chance to automate common code review chores.

This provides another logical step in your process, through this Danger can help lint your rote tasks in daily code review.

You can use Danger to codify your teams norms. Leaving humans to think about harder problems.

 For example?

You can:

 Enforce CHANGELOGs
 Enforce links to Trello/JIRA in PR/MR bodies
 Enforce using descriptive labels
 Look out for common anti-patterns
 Highlight interesting build artifacts
 Give specific files extra focus

Danger provides the glue to let _you_ build out the rules specific to your team's culture, offering useful metadata and a comprehensive plugin system to share common issues.

 Getting Started

Alright. So, actually, you may be in the wrong place. From here on in, this README is going to be for people who are interested in working on and improving on Danger.

We keep all of the end-user documentation at https://danger.systems.

Some quick links: Guides Index, DSL Reference, Getting Started and What does Danger Do?.

 I'm here to help out!

Brilliant. So, let's get you set up.

sh
git clone https://github.com/danger/danger.git
cd danger
bundle install
bundle exec rake spec


This sets everything up and runs all of the tests.

 Theory

Danger has a VISION.md file, which sums up the ideas around what Danger is. It is the lower bounds of what Danger means. Orta has written on handling and creating Danger on the Artsy blog, too.

 Documentation

The code you write may end up in the public part of the website — the easiest way to tell is that it is vastly overdocumented. If you are working in a space that looks over-documented, please be extra considerate to add documentation. We expect the consumers of that documentation to be non-rubyists, thus you should avoid specific jargon and try to provide duplicate overlapping examples.

 Testing

So far, we've not really figured out the right way to make tests for our CLI commands. When we have done so, they've ended up being brittle. So, ideally, try to move any logic that would go into a command into separate classes, and test those. We're okay with the command not having coverage, but ideally the classes that make up what it does will.

I'd strongly recommend using bundle exec guard to run your tests as you work. Any changes you make in the lib, or specs will have corresponding tests run instantly.

 Debugging

Ruby is super dynamic. One of the best ways to debug Ruby code is by using pry. We include pry for developers: when you have a problem, copy these two lines just before your problem and follow the instructions from "I Want To Be A Danger Wizard."

ruby
require 'pry'
binding.pry


 License, Contributor's Guidelines and Code of Conduct

We try to keep as much dis

Top issues

Discussions

Latest release

9.6.2 9.6.2 2026-11-09
Support git gem 6.0.0 - @karljamoralin 1560
 Allow faraday-http-cache 3.x - @JuanitoFatas 1553
 Support deploys from GitHub - @orta



[@glensc]: https://github.com/glensc
[@telyn]: https://github.com/telyn
[1192]: https://github.com/danger/danger/pull/1192
[1191]: https://github.com/danger/danger/issues/1191

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON