Better Programming

Advice for programmers.

Follow publication

Member-only story

Want to Automate Code Reviews? Set Up Danger JS for Unsupported CIs

Ardy Gallego Dedase
Better Programming
Published in
8 min readMay 15, 2022

What is Danger JS?

You can skip this section if you are already familiar with Danger JS.

Danger JS is an open-source build tool that allows software developers to automate common code review chores. Using Danger JS, we can automatically run a set of rules against your Pull Request (PR) and leave a code review comment.

It automates repetitive and trivial code review comments like:

This PR is large, please consider breaking it down so we can effectively review it.

or

Please update the changelog file.

It helps developers to focus on reviewing the problem that the PR is trying to solve, rather than getting distracted by code review chores.

An example code

To better understand how it works, let’s take a common use case as an example: What if we want to leave a comment if a pull request is too big?

You can write a JS function using Danger JS to accomplish this use case:

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web

Already have an account? Sign in

Ardy Gallego Dedase
Ardy Gallego Dedase

Written by Ardy Gallego Dedase

Software Engineer working remotely 🇨🇦 🇺🇸

Write a response