From f5a5d735fdb6d2c42a1ed3740b1bb8f129da4663 Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Mon, 9 Apr 2018 17:36:57 +0200 Subject: [PATCH] Auto correct Rubocop's Layout/EmptyLinesAroundModuleBody cop --- .rubocop_todo.yml | 17 ----------------- app/helpers/add_to_cart_helper.rb | 1 - app/helpers/groups_helper.rb | 2 -- .../column_preference_defaults.rb | 1 - lib/open_food_network/group_buy_report.rb | 1 - .../order_cycle_form_applicator.rb | 1 - lib/open_food_network/order_grouper.rb | 1 - .../variant_and_line_item_naming.rb | 1 - spec/models/spree/ability_spec.rb | 1 - spec/support/request/distribution_helper.rb | 1 - spec/support/request/ui_component_helper.rb | 1 - 11 files changed, 28 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 700d5a241b..b76318b28f 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -336,23 +336,6 @@ Layout/EmptyLinesAroundClassBody: - 'lib/open_food_network/rack_request_blocker.rb' - 'lib/open_food_network/reports/bulk_coop_report.rb' -# Offense count: 11 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -# SupportedStyles: empty_lines, empty_lines_except_namespace, empty_lines_special, no_empty_lines -Layout/EmptyLinesAroundModuleBody: - Exclude: - - 'app/helpers/add_to_cart_helper.rb' - - 'app/helpers/groups_helper.rb' - - 'lib/open_food_network/column_preference_defaults.rb' - - 'lib/open_food_network/group_buy_report.rb' - - 'lib/open_food_network/order_cycle_form_applicator.rb' - - 'lib/open_food_network/order_grouper.rb' - - 'lib/open_food_network/variant_and_line_item_naming.rb' - - 'spec/models/spree/ability_spec.rb' - - 'spec/support/request/distribution_helper.rb' - - 'spec/support/request/ui_component_helper.rb' - # Offense count: 55 # Cop supports --auto-correct. # Configuration parameters: AllowForAlignment, ForceEqualSignAlignment. diff --git a/app/helpers/add_to_cart_helper.rb b/app/helpers/add_to_cart_helper.rb index c8e657470d..6a1eec813f 100644 --- a/app/helpers/add_to_cart_helper.rb +++ b/app/helpers/add_to_cart_helper.rb @@ -18,5 +18,4 @@ module AddToCartHelper def available_order_cycles_for(order, product) DistributionChangeValidator.new(order).available_order_cycles_for(product) end - end diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb index c5de5c1ca0..7a9b782a3e 100644 --- a/app/helpers/groups_helper.rb +++ b/app/helpers/groups_helper.rb @@ -1,5 +1,4 @@ module GroupsHelper - def link_to_service(baseurl, name, html_options = {}) return if name.blank? html_options = html_options.merge target: '_blank' @@ -19,5 +18,4 @@ module GroupsHelper def strip_url(url) url.andand.sub(/^https?:\/\//i, '') end - end diff --git a/lib/open_food_network/column_preference_defaults.rb b/lib/open_food_network/column_preference_defaults.rb index ec2953a823..ee28e4b2a5 100644 --- a/lib/open_food_network/column_preference_defaults.rb +++ b/lib/open_food_network/column_preference_defaults.rb @@ -1,6 +1,5 @@ module OpenFoodNetwork module ColumnPreferenceDefaults - private # NOTE: These methods define valid column names (via hash keys) diff --git a/lib/open_food_network/group_buy_report.rb b/lib/open_food_network/group_buy_report.rb index 4a52929d77..bc3ef23d8d 100644 --- a/lib/open_food_network/group_buy_report.rb +++ b/lib/open_food_network/group_buy_report.rb @@ -1,5 +1,4 @@ module OpenFoodNetwork - GroupBuyVariantRow = Struct.new(:variant, :sum_quantities, :sum_max_quantities) do def to_row [variant.product.supplier.name, variant.product.name, I18n.t('admin.reports.unitsize'), variant.options_text, variant.weight, sum_quantities, sum_max_quantities] diff --git a/lib/open_food_network/order_cycle_form_applicator.rb b/lib/open_food_network/order_cycle_form_applicator.rb index d1aca3c55f..80e68881d4 100644 --- a/lib/open_food_network/order_cycle_form_applicator.rb +++ b/lib/open_food_network/order_cycle_form_applicator.rb @@ -1,7 +1,6 @@ require 'open_food_network/order_cycle_permissions' module OpenFoodNetwork - # There are two translator classes on the boundary between Angular and Rails: On the Angular side, # there is the OrderCycle#dataForSubmit method, and on the Rails side is this class. I think data # translation is more a responsibility of Angular, so I'd be inclined to refactor this class to move diff --git a/lib/open_food_network/order_grouper.rb b/lib/open_food_network/order_grouper.rb index c24d1069b8..b63b994407 100644 --- a/lib/open_food_network/order_grouper.rb +++ b/lib/open_food_network/order_grouper.rb @@ -1,5 +1,4 @@ module OpenFoodNetwork - class OrderGrouper def initialize(rules, column_constructors) @rules = rules diff --git a/lib/open_food_network/variant_and_line_item_naming.rb b/lib/open_food_network/variant_and_line_item_naming.rb index 42c78a80dc..148dadaf67 100644 --- a/lib/open_food_network/variant_and_line_item_naming.rb +++ b/lib/open_food_network/variant_and_line_item_naming.rb @@ -6,7 +6,6 @@ require 'open_food_network/option_value_namer' module OpenFoodNetwork module VariantAndLineItemNaming - # Copied and modified from Spree::Variant def options_text values = self.option_values.joins(:option_type).order("#{Spree::OptionType.table_name}.position asc") diff --git a/spec/models/spree/ability_spec.rb b/spec/models/spree/ability_spec.rb index 348f1efc1f..71e0c52eb1 100644 --- a/spec/models/spree/ability_spec.rb +++ b/spec/models/spree/ability_spec.rb @@ -3,7 +3,6 @@ require "cancan/matchers" require 'support/cancan_helper' module Spree - describe User do describe "broad permissions" do diff --git a/spec/support/request/distribution_helper.rb b/spec/support/request/distribution_helper.rb index a35c4d0c61..7a565cb2b9 100644 --- a/spec/support/request/distribution_helper.rb +++ b/spec/support/request/distribution_helper.rb @@ -1,6 +1,5 @@ module OpenFoodNetwork module DistributionHelper - def select_distribution(distributor, order_cycle=nil) create_enterprise_group_for distributor visit root_path diff --git a/spec/support/request/ui_component_helper.rb b/spec/support/request/ui_component_helper.rb index 873e933f36..1203a50222 100644 --- a/spec/support/request/ui_component_helper.rb +++ b/spec/support/request/ui_component_helper.rb @@ -1,5 +1,4 @@ module UIComponentHelper - def browse_as_medium page.driver.resize(1024, 768) end