From b277ff03ea4aa89e5f6ecc17cf0c3ec6d413eaf1 Mon Sep 17 00:00:00 2001 From: Rob Harrington Date: Fri, 19 May 2017 12:02:36 +1000 Subject: [PATCH] Rubocop: Auto-correct Style/TrailingBlankLines offences --- .rubocop_todo.yml | 7 ------- Guardfile | 1 - app/controllers/admin/product_import_controller.rb | 2 +- app/overrides/add_distributor_details_js_to_product.rb | 2 +- app/overrides/add_group_buy_to_admin_product_edit.rb | 2 +- app/overrides/add_orders_admin_sub_menu.rb | 2 +- app/overrides/remove_search_bar.rb | 2 +- app/overrides/remove_side_bar.rb | 1 - app/overrides/replace_order_details_steps_data.rb | 2 +- app/overrides/replace_payment_name_with_description.rb | 2 +- app/overrides/set_auth_token_in_backend.rb | 2 +- app/overrides/set_auth_token_in_frontend.rb | 2 +- app/serializers/api/admin/id_name_serializer.rb | 2 +- app/serializers/api/admin/taxon_serializer.rb | 2 +- app/serializers/api/country_serializer.rb | 2 +- app/serializers/api/id_serializer.rb | 2 +- app/serializers/api/state_serializer.rb | 2 +- app/views/api/enterprises/bulk_show.v1.rabl | 2 +- app/views/json/_current_order.rabl | 1 - app/views/json/_hubs.rabl | 1 - app/views/open_food_network/line_items/index.v1.rabl | 2 +- app/views/open_food_network/orders/index.v1.rabl | 2 +- app/views/open_food_network/orders/show.v1.rabl | 2 +- app/views/spree/api/products/bulk_index.v1.rabl | 2 +- app/views/spree/api/users/authorise_api.v1.rabl | 2 +- lib/open_food_network/model_class_from_controller_name.rb | 2 +- lib/tasks/enterprises.rake | 2 -- spec/features/admin/product_import_spec.rb | 2 +- spec/lib/open_food_network/order_grouper_spec.rb | 2 +- spec/serializers/admin/enterprise_serializer_spec.rb | 2 +- spec/support/cancan_helper.rb | 2 +- spec/support/matchers/delegate_matchers.rb | 2 +- spec/support/spree/url_helpers.rb | 2 +- spec/support/views/rabl_helper.rb | 1 - 34 files changed, 27 insertions(+), 41 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 3e3fe8fd8d..bdfc7040c4 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1320,13 +1320,6 @@ Style/TernaryParentheses: - 'app/controllers/spree/admin/payment_methods_controller_decorator.rb' - 'app/controllers/spree/admin/shipping_methods_controller_decorator.rb' -# Offense count: 34 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: final_newline, final_blank_line -Style/TrailingBlankLines: - Enabled: false - # Offense count: 4 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyleForMultiline, SupportedStylesForMultiline. diff --git a/Guardfile b/Guardfile index 5205fdcf62..9dc491669e 100644 --- a/Guardfile +++ b/Guardfile @@ -47,4 +47,3 @@ end #watch(%r{^spec/acceptance/(.+)\.feature$}) #watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' } #end - diff --git a/app/controllers/admin/product_import_controller.rb b/app/controllers/admin/product_import_controller.rb index 819fd3823b..c0adf10044 100644 --- a/app/controllers/admin/product_import_controller.rb +++ b/app/controllers/admin/product_import_controller.rb @@ -59,4 +59,4 @@ class Admin::ProductImportController < Spree::Admin::BaseController def model_class ProductImporter end -end \ No newline at end of file +end diff --git a/app/overrides/add_distributor_details_js_to_product.rb b/app/overrides/add_distributor_details_js_to_product.rb index 7ef0dc0c3a..607735b992 100644 --- a/app/overrides/add_distributor_details_js_to_product.rb +++ b/app/overrides/add_distributor_details_js_to_product.rb @@ -2,4 +2,4 @@ Deface::Override.new(:virtual_path => "spree/products/show", :insert_after => "[data-hook='product_show']", :text => "<%= javascript_include_tag main_app.distributors_enterprises_path(:format => :js) %>", :name => "add_distributor_details_js_to_product", - :original => 'b05ac497efeeebd4464f29891fd2c4a0f60c24d9') \ No newline at end of file + :original => 'b05ac497efeeebd4464f29891fd2c4a0f60c24d9') diff --git a/app/overrides/add_group_buy_to_admin_product_edit.rb b/app/overrides/add_group_buy_to_admin_product_edit.rb index 773febdb0c..eb44ca5c6c 100644 --- a/app/overrides/add_group_buy_to_admin_product_edit.rb +++ b/app/overrides/add_group_buy_to_admin_product_edit.rb @@ -2,4 +2,4 @@ Deface::Override.new(:virtual_path => "spree/admin/products/_form", :insert_top => "[data-hook='admin_product_form_right']", :partial => "spree/admin/products/group_buy_form", :name => "add_group_buy_to_admin_product_edit", - :original => '0c0e8d714989e48ee246a8253fb2b362f108621a') \ No newline at end of file + :original => '0c0e8d714989e48ee246a8253fb2b362f108621a') diff --git a/app/overrides/add_orders_admin_sub_menu.rb b/app/overrides/add_orders_admin_sub_menu.rb index 4c5c327657..ff26145421 100644 --- a/app/overrides/add_orders_admin_sub_menu.rb +++ b/app/overrides/add_orders_admin_sub_menu.rb @@ -1,4 +1,4 @@ Deface::Override.new(:virtual_path => "spree/admin/orders/index", :name => "add_orders_admin_sub_menu", :insert_before => "code[erb-silent]:contains('content_for :table_filter_title do')", - :text => "<%= render :partial => 'spree/admin/shared/order_sub_menu' %>") \ No newline at end of file + :text => "<%= render :partial => 'spree/admin/shared/order_sub_menu' %>") diff --git a/app/overrides/remove_search_bar.rb b/app/overrides/remove_search_bar.rb index debfa94346..3605bbeaed 100644 --- a/app/overrides/remove_search_bar.rb +++ b/app/overrides/remove_search_bar.rb @@ -1,3 +1,3 @@ Deface::Override.new(:virtual_path => "spree/shared/_nav_bar", :remove => "#search-bar", - :name => "search_removal") \ No newline at end of file + :name => "search_removal") diff --git a/app/overrides/remove_side_bar.rb b/app/overrides/remove_side_bar.rb index ce69795eaa..2496d867d5 100644 --- a/app/overrides/remove_side_bar.rb +++ b/app/overrides/remove_side_bar.rb @@ -1,4 +1,3 @@ Deface::Override.new(:virtual_path => "spree/shared/_sidebar", :remove => "#sidebar", :name => "sidebar_removal") - diff --git a/app/overrides/replace_order_details_steps_data.rb b/app/overrides/replace_order_details_steps_data.rb index fe5f4cc8b4..15e6f20075 100644 --- a/app/overrides/replace_order_details_steps_data.rb +++ b/app/overrides/replace_order_details_steps_data.rb @@ -2,4 +2,4 @@ Deface::Override.new(:virtual_path => "spree/shared/_order_details", :replace => "div.row.steps-data", :partial => "spree/shared/order_details_steps_data", :name => "replace_order_details_steps_data", - :original => '1a68aa5db3fee7f7bbb2b6b826749aeb69168cee') \ No newline at end of file + :original => '1a68aa5db3fee7f7bbb2b6b826749aeb69168cee') diff --git a/app/overrides/replace_payment_name_with_description.rb b/app/overrides/replace_payment_name_with_description.rb index 60566fe780..b808d20e38 100644 --- a/app/overrides/replace_payment_name_with_description.rb +++ b/app/overrides/replace_payment_name_with_description.rb @@ -2,4 +2,4 @@ Deface::Override.new(:virtual_path => "spree/payments/_payment", :replace => "code[erb-loud]:contains('content_tag(:span, payment.payment_method.name)')", :text => "<%= content_tag( :span, ( payment.payment_method.description || payment.payment_method.name ).html_safe ) %>", :name => "replace_payment_name_with_description", - :original => 'dff62efcadc0f9e6513b0f81a51ebbda035f78f6') \ No newline at end of file + :original => 'dff62efcadc0f9e6513b0f81a51ebbda035f78f6') diff --git a/app/overrides/set_auth_token_in_backend.rb b/app/overrides/set_auth_token_in_backend.rb index d794d68b28..4428fe4c17 100644 --- a/app/overrides/set_auth_token_in_backend.rb +++ b/app/overrides/set_auth_token_in_backend.rb @@ -2,4 +2,4 @@ Deface::Override.new(:virtual_path => "spree/layouts/admin", :insert_bottom => "[data-hook='admin_inside_head']", :partial => "layouts/auth_token_script", :name => "set_auth_token_in_backend", - :original => '6bc2c5de1c8f7542d033548557437c9fe4b3ba02') \ No newline at end of file + :original => '6bc2c5de1c8f7542d033548557437c9fe4b3ba02') diff --git a/app/overrides/set_auth_token_in_frontend.rb b/app/overrides/set_auth_token_in_frontend.rb index 6797955b36..bcf087c456 100644 --- a/app/overrides/set_auth_token_in_frontend.rb +++ b/app/overrides/set_auth_token_in_frontend.rb @@ -2,4 +2,4 @@ Deface::Override.new(:virtual_path => "spree/layouts/spree_application", :insert_bottom => "[data-hook='inside_head']", :partial => "layouts/auth_token_script", :name => "set_auth_token_in_frontend", - :original => '5659ac7dbf6ac6469907b005b85285b894677815') \ No newline at end of file + :original => '5659ac7dbf6ac6469907b005b85285b894677815') diff --git a/app/serializers/api/admin/id_name_serializer.rb b/app/serializers/api/admin/id_name_serializer.rb index 1853aa46aa..0f3811611c 100644 --- a/app/serializers/api/admin/id_name_serializer.rb +++ b/app/serializers/api/admin/id_name_serializer.rb @@ -1,3 +1,3 @@ class Api::Admin::IdNameSerializer < ActiveModel::Serializer attributes :id, :name -end \ No newline at end of file +end diff --git a/app/serializers/api/admin/taxon_serializer.rb b/app/serializers/api/admin/taxon_serializer.rb index 61766c87cf..382a5f8181 100644 --- a/app/serializers/api/admin/taxon_serializer.rb +++ b/app/serializers/api/admin/taxon_serializer.rb @@ -1,3 +1,3 @@ class Api::Admin::TaxonSerializer < ActiveModel::Serializer attributes :id, :name, :pretty_name -end \ No newline at end of file +end diff --git a/app/serializers/api/country_serializer.rb b/app/serializers/api/country_serializer.rb index 6561692cf6..8a7bca33de 100644 --- a/app/serializers/api/country_serializer.rb +++ b/app/serializers/api/country_serializer.rb @@ -2,4 +2,4 @@ class Api::CountrySerializer < ActiveModel::Serializer attributes :id, :name, :states has_many :states, serializer: Api::StateSerializer -end \ No newline at end of file +end diff --git a/app/serializers/api/id_serializer.rb b/app/serializers/api/id_serializer.rb index bbd9b0ad56..0093338e6e 100644 --- a/app/serializers/api/id_serializer.rb +++ b/app/serializers/api/id_serializer.rb @@ -1,3 +1,3 @@ class Api::IdSerializer < ActiveModel::Serializer attributes :id -end \ No newline at end of file +end diff --git a/app/serializers/api/state_serializer.rb b/app/serializers/api/state_serializer.rb index 7a76e340b4..a43e5665b3 100644 --- a/app/serializers/api/state_serializer.rb +++ b/app/serializers/api/state_serializer.rb @@ -4,4 +4,4 @@ class Api::StateSerializer < ActiveModel::Serializer def abbr object.abbr.upcase end -end \ No newline at end of file +end diff --git a/app/views/api/enterprises/bulk_show.v1.rabl b/app/views/api/enterprises/bulk_show.v1.rabl index 5a40b74aa1..4cc671a3f1 100644 --- a/app/views/api/enterprises/bulk_show.v1.rabl +++ b/app/views/api/enterprises/bulk_show.v1.rabl @@ -1,3 +1,3 @@ object @enterprise -attributes :id, :name \ No newline at end of file +attributes :id, :name diff --git a/app/views/json/_current_order.rabl b/app/views/json/_current_order.rabl index 3ea31c2137..167f94ea14 100644 --- a/app/views/json/_current_order.rabl +++ b/app/views/json/_current_order.rabl @@ -10,4 +10,3 @@ if current_order cart_count end end - diff --git a/app/views/json/_hubs.rabl b/app/views/json/_hubs.rabl index 7f8c4ac7b4..66cbdee277 100644 --- a/app/views/json/_hubs.rabl +++ b/app/views/json/_hubs.rabl @@ -1,4 +1,3 @@ collection Enterprise.is_distributor.visible extends 'json/partials/enterprise' extends 'json/partials/hub' - diff --git a/app/views/open_food_network/line_items/index.v1.rabl b/app/views/open_food_network/line_items/index.v1.rabl index 60977b9251..3bc817063f 100644 --- a/app/views/open_food_network/line_items/index.v1.rabl +++ b/app/views/open_food_network/line_items/index.v1.rabl @@ -1,3 +1,3 @@ collection @line_items -extends "open_food_network/line_items/show" \ No newline at end of file +extends "open_food_network/line_items/show" diff --git a/app/views/open_food_network/orders/index.v1.rabl b/app/views/open_food_network/orders/index.v1.rabl index 0978ff636c..157b3c6132 100644 --- a/app/views/open_food_network/orders/index.v1.rabl +++ b/app/views/open_food_network/orders/index.v1.rabl @@ -1,3 +1,3 @@ collection @orders -extends "open_food_network/orders/show" \ No newline at end of file +extends "open_food_network/orders/show" diff --git a/app/views/open_food_network/orders/show.v1.rabl b/app/views/open_food_network/orders/show.v1.rabl index ed8c709285..6b49a45831 100644 --- a/app/views/open_food_network/orders/show.v1.rabl +++ b/app/views/open_food_network/orders/show.v1.rabl @@ -4,4 +4,4 @@ attributes :id node( :distributor ) { |p| p.distributor.blank? ? "" : p.distributor.name } node( :line_items ) do |p| partial '/open_food_network/line_items/index', object: p.line_items -end \ No newline at end of file +end diff --git a/app/views/spree/api/products/bulk_index.v1.rabl b/app/views/spree/api/products/bulk_index.v1.rabl index e35c8c9d59..dfb9f20f2a 100644 --- a/app/views/spree/api/products/bulk_index.v1.rabl +++ b/app/views/spree/api/products/bulk_index.v1.rabl @@ -1,2 +1,2 @@ collection @products.order('id ASC') -extends "spree/api/products/bulk_show" \ No newline at end of file +extends "spree/api/products/bulk_show" diff --git a/app/views/spree/api/users/authorise_api.v1.rabl b/app/views/spree/api/users/authorise_api.v1.rabl index 7cb0064e2e..cef3d960f1 100644 --- a/app/views/spree/api/users/authorise_api.v1.rabl +++ b/app/views/spree/api/users/authorise_api.v1.rabl @@ -1,2 +1,2 @@ object false -node(:success) { "Use of API Authorised" } \ No newline at end of file +node(:success) { "Use of API Authorised" } diff --git a/lib/open_food_network/model_class_from_controller_name.rb b/lib/open_food_network/model_class_from_controller_name.rb index 6c6a8147e8..97b92a18d7 100644 --- a/lib/open_food_network/model_class_from_controller_name.rb +++ b/lib/open_food_network/model_class_from_controller_name.rb @@ -5,4 +5,4 @@ module OpenFoodNetwork self.class.to_s.sub("Controller", "").underscore.split('/').last.singularize.to_sym end end -end \ No newline at end of file +end diff --git a/lib/tasks/enterprises.rake b/lib/tasks/enterprises.rake index f08f75a09a..c9206b3bd1 100644 --- a/lib/tasks/enterprises.rake +++ b/lib/tasks/enterprises.rake @@ -28,5 +28,3 @@ namespace :openfoodnetwork do end end end - - diff --git a/spec/features/admin/product_import_spec.rb b/spec/features/admin/product_import_spec.rb index 5843330a7f..82e1c6e91a 100644 --- a/spec/features/admin/product_import_spec.rb +++ b/spec/features/admin/product_import_spec.rb @@ -340,4 +340,4 @@ feature "Product Import", js: true do potatoes.available_on.should be_within(1.day).of(Time.zone.local(2020, 1, 1)) end end -end \ No newline at end of file +end diff --git a/spec/lib/open_food_network/order_grouper_spec.rb b/spec/lib/open_food_network/order_grouper_spec.rb index 6982db2988..56112a0a00 100644 --- a/spec/lib/open_food_network/order_grouper_spec.rb +++ b/spec/lib/open_food_network/order_grouper_spec.rb @@ -149,4 +149,4 @@ module OpenFoodNetwork end end end -end \ No newline at end of file +end diff --git a/spec/serializers/admin/enterprise_serializer_spec.rb b/spec/serializers/admin/enterprise_serializer_spec.rb index bcaffcd291..b8226a73e5 100644 --- a/spec/serializers/admin/enterprise_serializer_spec.rb +++ b/spec/serializers/admin/enterprise_serializer_spec.rb @@ -4,4 +4,4 @@ describe Api::Admin::EnterpriseSerializer do serializer = Api::Admin::EnterpriseSerializer.new enterprise serializer.to_json.should match enterprise.name end -end \ No newline at end of file +end diff --git a/spec/support/cancan_helper.rb b/spec/support/cancan_helper.rb index 8bad9e1394..e5390372f4 100644 --- a/spec/support/cancan_helper.rb +++ b/spec/support/cancan_helper.rb @@ -30,4 +30,4 @@ module Spree "have ability #{ability_hash.keys.join(", ")} for #{target.class.name}" end end -end \ No newline at end of file +end diff --git a/spec/support/matchers/delegate_matchers.rb b/spec/support/matchers/delegate_matchers.rb index 4921e3eb99..20e173a562 100644 --- a/spec/support/matchers/delegate_matchers.rb +++ b/spec/support/matchers/delegate_matchers.rb @@ -37,4 +37,4 @@ RSpec::Matchers.define :delegate do |method| chain(:to) { |receiver| @to = receiver } chain(:with_prefix) { @prefix = true } -end \ No newline at end of file +end diff --git a/spec/support/spree/url_helpers.rb b/spec/support/spree/url_helpers.rb index c14c659fe9..0be58fa899 100644 --- a/spec/support/spree/url_helpers.rb +++ b/spec/support/spree/url_helpers.rb @@ -4,4 +4,4 @@ module Spree Spree::Core::Engine.routes.url_helpers end end -end \ No newline at end of file +end diff --git a/spec/support/views/rabl_helper.rb b/spec/support/views/rabl_helper.rb index f6d6fc797a..295a2ef07d 100644 --- a/spec/support/views/rabl_helper.rb +++ b/spec/support/views/rabl_helper.rb @@ -10,4 +10,3 @@ module RablHelper include ActionView::Helpers::AssetTagHelper end end -