Skip to content

Instantly share code, notes, and snippets.

@michaelkl
michaelkl / rubocop.rb
Created March 19, 2020 11:47 — forked from skanev/rubocop.rb
A Rubocop wrapper that checks only added/modified code
#!/usr/bin/env ruby
# frozen_string_literal: true
# Source: https://gist.github.com/skanev/9d4bec97d5a6825eaaf6
#
# A sneaky wrapper around Rubocop that allows you to run it only against
# the recent changes, as opposed to the whole project. It lets you
# enforce the style guide for new/modified code only, as opposed to
# having to restyle everything or adding cops incrementally. It relies
# on git to figure out which files to check.