From 9da33b4e825d1c1f6b61d9d1ba68a749b81930ba Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Mon, 9 Apr 2018 18:46:11 +0200 Subject: [PATCH] Auto correct Rubocop's Layout/EmptyLinesAroundAccessModifier cop This also `script/rubocop_autocorrect` to automate the process of fixing a cop and comitting the changes. --- .rubocop_todo.yml | 10 ---------- script/rubocop_autocorrect | 7 +++++++ 2 files changed, 7 insertions(+), 10 deletions(-) create mode 100755 script/rubocop_autocorrect diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index d817553734..b80f2ed33b 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -245,16 +245,6 @@ Layout/EmptyLines: - 'spec/support/delayed_job_helper.rb' - 'spec/support/matchers/table_matchers.rb' -# Offense count: 6 -# Cop supports --auto-correct. -Layout/EmptyLinesAroundAccessModifier: - Exclude: - - 'app/controllers/admin/order_cycles_controller.rb' - - 'app/controllers/spree/admin/shipping_methods_controller_decorator.rb' - - 'app/helpers/angular_form_builder.rb' - - 'spec/helpers/products_helper_spec.rb' - - 'spec/support/request/web_helper.rb' - # Offense count: 66 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. diff --git a/script/rubocop_autocorrect b/script/rubocop_autocorrect new file mode 100755 index 0000000000..bacbb97dcc --- /dev/null +++ b/script/rubocop_autocorrect @@ -0,0 +1,7 @@ +#!/bin/sh + +$COP=$1 + +bundle exec rubocop -a --only "$COP" +git add -A +git commit -m "Auto correct Rubocop's ${COP} cop"