#!/bin/sh

# Usage
#
# 1. Clean any git unstagged or untracked changes. Consider creating a new branch
# 2. Remove a cop's exclusion paragraph from the .rubocop_todo.yml
# 3. Run:
#
#   $ ./script/rubocop_autocorrect <removed_cop_name>
#
# This will commit all the changes.

set -e

COP="$1"

bundle exec rubocop -a --only "$COP"
git add -A
git commit -m "Auto correct Rubocop's ${COP} cop"
