0.0
Low commit activity in last 3 years
RuboCop for git diff.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

~> 1.0
 Project Readme

NOTE: this is a drop-in replacement for the unmaintained https://github.com/m4i/rubocop-git

Gem Version Build Status

RuboCop::Git

RuboCop for git diff.

Installation

Add or install rubocop-git2.

Usage

Examples

# check unstaged changes
rubocop-git

# check staged changes
rubocop-git --staged

# positional arguments are passed as git refs to git diff, e.g.:

# check both staged and unstaged changes
rubocop-git HEAD

# check the previous commit
rubocop-git HEAD~1 HEAD

# check changes between two tags
rubocop-git v1.0.0 v1.0.1

# check all changes in a branch in github actions
bundle exec rubocop-git origin/${{ github.base_ref }}

Options

Output of rubocop-git --help:

Usage: rubocop-git [options] [[commit] commit]
    -c, --config FILE                Specify configuration file
    -d, --debug                      Display debug info
    -D, --display-cop-names          Display cop names in offense messages
    -f, --format FORMAT              Set output format (see rubocop --help)
        --hound                      Hound compatibility mode
        --only COP1,COP2             Run only specific cops or departments
    -r, --require FILE               Require Ruby file
        --staged                     Inspect staged changes
        --version                    Display version