From 11081ab1d61397c938b27b98dfc22f55c4131d82 Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Mon, 23 Apr 2018 12:51:09 +0200 Subject: [PATCH 1/2] Autocorrect Rubocop's Layout/CommentIndentation cop --- .rubocop_todo.yml | 7 ----- Guardfile | 40 +------------------------ lib/open_food_network/packing_report.rb | 6 ---- script/rubocop_autocorrect | 10 +++++++ 4 files changed, 11 insertions(+), 52 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 72bef1c992..e94f716a1f 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -84,13 +84,6 @@ Layout/AlignParameters: - 'spec/lib/open_food_network/user_balance_calculator_spec.rb' - 'spec/support/request/authentication_workflow.rb' -# Offense count: 8 -# Cop supports --auto-correct. -Layout/CommentIndentation: - Exclude: - - 'Guardfile' - - 'lib/open_food_network/packing_report.rb' - # Offense count: 8 # Cop supports --auto-correct. Layout/ElseAlignment: diff --git a/Guardfile b/Guardfile index 9dc491669e..4ae1efda60 100644 --- a/Guardfile +++ b/Guardfile @@ -5,45 +5,7 @@ guard 'livereload' do watch(%r{app/views/.+\.(erb|haml|slim)$}) watch(%r{app/helpers/.+\.rb}) watch(%r{public/.+\.(css|js|html)}) - #watch(%r{config/locales/.+\.yml}) + # Rails Assets Pipeline watch(%r{(app|vendor)(/assets/\w+/(.+\.(css|js|html|png|jpg))).*}) { |m| "/assets/#{m[3]}" } end - - -#guard 'rails' do - #watch('Gemfile.lock') - #watch(%r{^(config|lib)/.*}) -#end - - -#guard 'zeus' do - ## uses the .rspec file - ## --colour --fail-fast --format documentation --tag ~slow - #watch(%r{^spec/.+_spec\.rb$}) - #watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } - #watch(%r{^app/(.+)\.haml$}) { |m| "spec/#{m[1]}.haml_spec.rb" } - #watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } - #watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/requests/#{m[1]}_spec.rb"] } -#end - -#guard :rspec do - #watch(%r{^spec/.+_spec\.rb$}) - #watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" } - #watch('spec/spec_helper.rb') { "spec" } - - ## Rails example - #watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" } - #watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" } - #watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] } - #watch(%r{^spec/support/(.+)\.rb$}) { "spec" } - #watch('config/routes.rb') { "spec/routing" } - #watch('app/controllers/application_controller.rb') { "spec/controllers" } - - ## Capybara features specs - #watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" } - - ## Turnip features and steps - #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/lib/open_food_network/packing_report.rb b/lib/open_food_network/packing_report.rb index 4c9eb783ec..d24048fcf6 100644 --- a/lib/open_food_network/packing_report.rb +++ b/lib/open_food_network/packing_report.rb @@ -59,9 +59,6 @@ module OpenFoodNetwork def rules if is_by_customer? -# customer_rows orders -# table_items = @line_items - [ { group_by: proc { |line_item| line_item.order.distributor }, sort_by: proc { |distributor| distributor.name } }, @@ -84,9 +81,6 @@ module OpenFoodNetwork sort_by: proc { |full_name| full_name } } ] else -# supplier_rows orders -# table_items = supplier_rows orders -# [ { group_by: proc { |line_item| line_item.order.distributor }, sort_by: proc { |distributor| distributor.name } }, { group_by: proc { |line_item| line_item.product.supplier }, diff --git a/script/rubocop_autocorrect b/script/rubocop_autocorrect index 1ca248ddfa..f9e7cac2fc 100755 --- a/script/rubocop_autocorrect +++ b/script/rubocop_autocorrect @@ -1,5 +1,15 @@ #!/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 +# +# This will commit all the changes. + set -e COP="$1" From 25ad9b22aae814d20220c9eecf8983bb3941e1f7 Mon Sep 17 00:00:00 2001 From: Pau Perez Date: Mon, 23 Apr 2018 13:03:05 +0200 Subject: [PATCH 2/2] Update .rubocop_todo.yml --- .rubocop_todo.yml | 182 ++++++++++++++++++++-------------------------- 1 file changed, 79 insertions(+), 103 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e94f716a1f..bd93ff1266 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,12 +1,12 @@ # This configuration was generated by # `rubocop --auto-gen-config --exclude-limit 1400` -# on 2018-02-01 09:48:08 +0100 using RuboCop version 0.49.1. +# on 2018-04-23 13:00:19 +0200 using RuboCop version 0.49.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 37 +# Offense count: 36 # Cop supports --auto-correct. # Configuration parameters: Include, TreatCommentsAsGroupSeparators. # Include: **/Gemfile, **/gems.rb @@ -28,7 +28,7 @@ Layout/AlignArray: - 'spec/lib/open_food_network/order_and_distributor_report_spec.rb' - 'spec/lib/open_food_network/order_grouper_spec.rb' -# Offense count: 133 +# Offense count: 135 # Cop supports --auto-correct. # Configuration parameters: EnforcedHashRocketStyle, SupportedHashRocketStyles, EnforcedColonStyle, SupportedColonStyles, EnforcedLastArgumentHashStyle, SupportedLastArgumentHashStyles. # SupportedHashRocketStyles: key, separator, table @@ -48,6 +48,7 @@ Layout/AlignHash: - 'spec/features/admin/order_cycles_spec.rb' - 'spec/features/admin/products_spec.rb' - 'spec/features/admin/variant_overrides_spec.rb' + - 'spec/features/consumer/shopping/cart_spec.rb' - 'spec/lib/open_food_network/customers_report_spec.rb' - 'spec/lib/open_food_network/enterprise_fee_calculator_spec.rb' - 'spec/lib/open_food_network/permissions_spec.rb' @@ -59,7 +60,7 @@ Layout/AlignHash: - 'spec/models/spree/shipping_method_spec.rb' - 'spec/models/spree/variant_spec.rb' -# Offense count: 44 +# Offense count: 58 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. # SupportedStyles: with_first_parameter, with_fixed_indentation @@ -79,11 +80,25 @@ Layout/AlignParameters: - 'spec/controllers/enterprises_controller_spec.rb' - 'spec/controllers/shop_controller_spec.rb' - 'spec/features/admin/enterprise_relationships_spec.rb' + - 'spec/features/admin/order_cycles_spec.rb' - 'spec/features/consumer/shopping/checkout_spec.rb' - 'spec/helpers/enterprises_helper_spec.rb' - 'spec/lib/open_food_network/user_balance_calculator_spec.rb' + - 'spec/serializers/variant_serializer_spec.rb' - 'spec/support/request/authentication_workflow.rb' +# Offense count: 1 +# Cop supports --auto-correct. +Layout/BlockEndNewline: + Exclude: + - 'spec/features/consumer/shopping/cart_spec.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +Layout/ClosingParenthesisIndentation: + Exclude: + - 'spec/features/admin/order_cycles_spec.rb' + # Offense count: 8 # Cop supports --auto-correct. Layout/ElseAlignment: @@ -99,7 +114,6 @@ Layout/ElseAlignment: # Cop supports --auto-correct. Layout/EmptyLines: Exclude: - - 'Guardfile' - 'app/controllers/admin/enterprise_fees_controller.rb' - 'app/controllers/admin/order_cycles_controller.rb' - 'app/controllers/admin/producer_properties_controller.rb' @@ -157,12 +171,10 @@ Layout/EmptyLines: - 'lib/open_food_network/enterprise_fee_calculator.rb' - 'lib/open_food_network/enterprise_issue_validator.rb' - 'lib/open_food_network/integrity_checker.rb' - - 'lib/open_food_network/last_used_address.rb' - 'lib/open_food_network/lettuce_share_report.rb' - 'lib/open_food_network/option_value_namer.rb' - 'lib/open_food_network/order_cycle_form_applicator.rb' - 'lib/open_food_network/order_cycle_permissions.rb' - - 'lib/open_food_network/permissions.rb' - 'lib/open_food_network/products_cache.rb' - 'lib/open_food_network/products_cache_integrity_checker.rb' - 'lib/open_food_network/products_cache_refreshment.rb' @@ -182,6 +194,7 @@ Layout/EmptyLines: - 'spec/controllers/admin/column_preferences_controller_spec.rb' - 'spec/controllers/admin/enterprises_controller_spec.rb' - 'spec/controllers/admin/order_cycles_controller_spec.rb' + - 'spec/controllers/admin/subscription_line_items_controller_spec.rb' - 'spec/controllers/enterprises_controller_spec.rb' - 'spec/controllers/shop_controller_spec.rb' - 'spec/controllers/spree/admin/payments_controller_spec.rb' @@ -225,6 +238,7 @@ Layout/EmptyLines: - 'spec/models/model_set_spec.rb' - 'spec/models/product_distribution_spec.rb' - 'spec/models/spree/adjustment_spec.rb' + - 'spec/models/spree/line_item_spec.rb' - 'spec/models/spree/order_populator_spec.rb' - 'spec/models/spree/order_spec.rb' - 'spec/models/spree/product_spec.rb' @@ -238,7 +252,7 @@ Layout/EmptyLines: - 'spec/support/delayed_job_helper.rb' - 'spec/support/matchers/table_matchers.rb' -# Offense count: 66 +# Offense count: 65 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: empty_lines, no_empty_lines @@ -246,7 +260,6 @@ Layout/EmptyLinesAroundBlockBody: Exclude: - 'app/controllers/spree/admin/orders_controller_decorator.rb' - 'app/controllers/spree/admin/reports_controller_decorator.rb' - - 'app/controllers/spree/admin/variants_controller_decorator.rb' - 'app/controllers/spree/api/orders_controller_decorator.rb' - 'app/controllers/spree/api/products_controller_decorator.rb' - 'app/controllers/spree/checkout_controller_decorator.rb' @@ -260,11 +273,11 @@ Layout/EmptyLinesAroundBlockBody: - 'lib/tasks/users.rake' - 'spec/controllers/admin/tag_rules_controller_spec.rb' - 'spec/controllers/cart_controller_spec.rb' - - 'spec/controllers/enterprise_confirmations_controller_spec.rb' - 'spec/controllers/spree/admin/orders_controller_spec.rb' - 'spec/controllers/spree/admin/reports_controller_spec.rb' - 'spec/controllers/spree/api/orders_controller_spec.rb' - 'spec/controllers/spree/orders_controller_spec.rb' + - 'spec/controllers/user_confirmations_controller_spec.rb' - 'spec/controllers/user_registrations_controller_spec.rb' - 'spec/features/admin/caching_spec.rb' - 'spec/features/admin/orders_spec.rb' @@ -329,7 +342,7 @@ Layout/EmptyLinesAroundClassBody: - 'lib/open_food_network/rack_request_blocker.rb' - 'lib/open_food_network/reports/bulk_coop_report.rb' -# Offense count: 55 +# Offense count: 54 # Cop supports --auto-correct. # Configuration parameters: AllowForAlignment, ForceEqualSignAlignment. Layout/ExtraSpacing: @@ -372,7 +385,7 @@ Layout/ExtraSpacing: - 'spec/spec_helper.rb' - 'spec/support/request/web_helper.rb' -# Offense count: 3 +# Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: SupportedStyles, IndentationWidth. # SupportedStyles: special_inside_parentheses, consistent, align_brackets @@ -402,7 +415,7 @@ Layout/IndentHash: - 'spec/lib/open_food_network/order_cycle_form_applicator_spec.rb' - 'spec/support/request/authentication_workflow.rb' -# Offense count: 21 +# Offense count: 20 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: normal, rails @@ -410,14 +423,13 @@ Layout/IndentationConsistency: Exclude: - 'app/controllers/spree/admin/reports_controller_decorator.rb' - 'lib/open_food_network/permissions.rb' - - 'spec/controllers/admin/order_cycles_controller_spec.rb' - 'spec/controllers/admin/tag_rules_controller_spec.rb' - 'spec/features/consumer/shopping/checkout_spec.rb' - 'spec/helpers/admin/business_model_configuration_helper_spec.rb' - 'spec/models/spree/line_item_spec.rb' - 'spec/models/spree/product_spec.rb' -# Offense count: 18 +# Offense count: 21 # Cop supports --auto-correct. # Configuration parameters: Width, IgnoredPatterns. Layout/IndentationWidth: @@ -436,14 +448,15 @@ Layout/IndentationWidth: - 'spec/lib/open_food_network/enterprise_fee_calculator_spec.rb' - 'spec/lib/open_food_network/order_grouper_spec.rb' - 'spec/lib/spree/product_filters_spec.rb' + - 'spec/mailers/enterprise_mailer_spec.rb' - 'spec/models/enterprise_spec.rb' + - 'spec/models/spree/calculator/flexi_rate_spec.rb' -# Offense count: 78 +# Offense count: 52 # Cop supports --auto-correct. Layout/LeadingCommentSpace: Exclude: - 'Gemfile' - - 'Guardfile' - 'app/models/billable_period.rb' - 'app/models/content_configuration.rb' - 'app/models/product_importer.rb' @@ -477,11 +490,11 @@ Layout/MultilineBlockLayout: Exclude: - 'app/models/spree/calculator/default_tax_decorator.rb' - 'app/models/spree/product_decorator.rb' - - 'lib/open_food_network/users_and_enterprises_report.rb' - 'spec/controllers/admin/column_preferences_controller_spec.rb' - 'spec/controllers/shop_controller_spec.rb' - 'spec/controllers/spree/orders_controller_spec.rb' - 'spec/features/admin/variant_overrides_spec.rb' + - 'spec/features/consumer/shopping/cart_spec.rb' - 'spec/helpers/enterprises_helper_spec.rb' - 'spec/jobs/update_billable_periods_spec.rb' - 'spec/lib/open_food_network/enterprise_fee_calculator_spec.rb' @@ -505,7 +518,7 @@ Layout/MultilineHashBraceLayout: - 'spec/controllers/admin/order_cycles_controller_spec.rb' - 'spec/support/request/authentication_workflow.rb' -# Offense count: 6 +# Offense count: 7 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: symmetrical, new_line, same_line @@ -515,20 +528,19 @@ Layout/MultilineMethodCallBraceLayout: - 'app/models/spree/variant_decorator.rb' - 'app/overrides/add_capture_order_shortcut.rb' - 'lib/open_food_network/products_renderer.rb' + - 'spec/features/admin/order_cycles_spec.rb' - 'spec/lib/open_food_network/products_and_inventory_report_spec.rb' -# Offense count: 7 +# Offense count: 4 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. # SupportedStyles: aligned, indented, indented_relative_to_receiver Layout/MultilineMethodCallIndentation: Exclude: - - 'spec/controllers/spree/admin/payments_controller_spec.rb' - 'spec/lib/open_food_network/cached_products_renderer_spec.rb' - - 'spec/requests/checkout/paypal_spec.rb' - 'spec/serializers/variant_serializer_spec.rb' -# Offense count: 33 +# Offense count: 34 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth. # SupportedStyles: aligned, indented @@ -560,7 +572,7 @@ Layout/SpaceAfterColon: - 'spec/models/variant_override_spec.rb' - 'spec/spec_helper.rb' -# Offense count: 53 +# Offense count: 85 # Cop supports --auto-correct. Layout/SpaceAfterComma: Exclude: @@ -583,7 +595,9 @@ Layout/SpaceAfterComma: - 'spec/jobs/update_account_invoices_spec.rb' - 'spec/lib/open_food_network/group_buy_report_spec.rb' - 'spec/lib/open_food_network/order_and_distributor_report_spec.rb' + - 'spec/lib/open_food_network/subscription_summary_spec.rb' - 'spec/models/content_configuration_spec.rb' + - 'spec/models/spree/line_item_spec.rb' - 'spec/models/spree/order_spec.rb' - 'spec/models/tag_rule/discount_order_spec.rb' - 'spec/models/tag_rule/filter_order_cycles_spec.rb' @@ -593,12 +607,11 @@ Layout/SpaceAfterComma: - 'spec/spec_helper.rb' - 'spec/support/cancan_helper.rb' -# Offense count: 3 +# Offense count: 2 # Cop supports --auto-correct. Layout/SpaceAfterSemicolon: Exclude: - 'spec/controllers/spree/admin/base_controller_spec.rb' - - 'spec/models/enterprise_spec.rb' # Offense count: 65 # Cop supports --auto-correct. @@ -681,33 +694,25 @@ Layout/SpaceAroundOperators: - 'spec/support/cancan_helper.rb' - 'spec/support/seeds.rb' -# Offense count: 6 +# Offense count: 5 # Cop supports --auto-correct. Layout/SpaceBeforeComma: Exclude: - 'app/helpers/checkout_helper.rb' - - 'app/models/spree/ability_decorator.rb' - 'lib/open_food_network/orders_and_fulfillments_report.rb' - 'spec/features/admin/bulk_order_management_spec.rb' - 'spec/features/admin/bulk_product_update_spec.rb' -# Offense count: 6 +# Offense count: 5 # Cop supports --auto-correct. # Configuration parameters: AllowForAlignment. Layout/SpaceBeforeFirstArg: Exclude: - 'spec/factories.rb' - 'spec/features/admin/bulk_product_update_spec.rb' - - 'spec/features/admin/product_import_spec.rb' - 'spec/features/consumer/multilingual_spec.rb' - 'spec/models/enterprise_fee_spec.rb' -# Offense count: 1 -# Cop supports --auto-correct. -Layout/SpaceBeforeSemicolon: - Exclude: - - 'spec/models/enterprise_spec.rb' - # Offense count: 5 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. @@ -717,7 +722,7 @@ Layout/SpaceInLambdaLiteral: - 'app/models/spree/product_decorator.rb' - 'app/models/spree/variant_decorator.rb' -# Offense count: 187 +# Offense count: 194 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SupportedStylesForEmptyBraces, SpaceBeforeBlockParameters. # SupportedStyles: space, no_space @@ -762,7 +767,6 @@ Layout/SpaceInsideBlockBraces: - 'spec/lib/open_food_network/tag_rule_applicator_spec.rb' - 'spec/models/column_preference_spec.rb' - 'spec/models/enterprise_relationship_spec.rb' - - 'spec/models/enterprise_spec.rb' - 'spec/models/spree/line_item_spec.rb' - 'spec/models/spree/order_spec.rb' - 'spec/models/spree/payment_spec.rb' @@ -773,13 +777,12 @@ Layout/SpaceInsideBlockBraces: - 'spec/spec_helper.rb' - 'spec/support/cancan_helper.rb' -# Offense count: 140 +# Offense count: 134 # Cop supports --auto-correct. Layout/SpaceInsideBrackets: Exclude: - 'app/controllers/admin/order_cycles_controller.rb' - 'app/helpers/spree/reports_helper.rb' - - 'app/models/enterprise.rb' - 'app/serializers/api/admin/exchange_serializer.rb' - 'lib/open_food_network/bulk_coop_report.rb' - 'lib/open_food_network/order_and_distributor_report.rb' @@ -796,7 +799,7 @@ Layout/SpaceInsideBrackets: - 'spec/lib/open_food_network/users_and_enterprises_report_spec.rb' - 'spec/performance/orders_controller_spec.rb' -# Offense count: 778 +# Offense count: 784 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, EnforcedStyleForEmptyBraces, SupportedStylesForEmptyBraces. # SupportedStyles: space, no_space, compact @@ -807,7 +810,6 @@ Layout/SpaceInsideHashLiteralBraces: - 'app/controllers/admin/contents_controller.rb' - 'app/controllers/admin/enterprise_relationships_controller.rb' - 'app/controllers/admin/enterprise_roles_controller.rb' - - 'app/controllers/admin/order_cycles_controller.rb' - 'app/controllers/api/statuses_controller.rb' - 'app/controllers/checkout_controller.rb' - 'app/controllers/spree/admin/line_items_controller_decorator.rb' @@ -851,7 +853,9 @@ Layout/SpaceInsideHashLiteralBraces: - 'spec/controllers/admin/accounts_and_billing_settings_controller_spec.rb' - 'spec/controllers/admin/business_model_configuration_controller_spec.rb' - 'spec/controllers/admin/enterprises_controller_spec.rb' + - 'spec/controllers/admin/manager_invitations_controller_spec.rb' - 'spec/controllers/admin/order_cycles_controller_spec.rb' + - 'spec/controllers/admin/subscriptions_controller_spec.rb' - 'spec/controllers/api/statuses_controller_spec.rb' - 'spec/controllers/cart_controller_spec.rb' - 'spec/controllers/checkout_controller_spec.rb' @@ -907,6 +911,8 @@ Layout/SpaceInsideHashLiteralBraces: - 'spec/requests/checkout/failed_checkout_spec.rb' - 'spec/requests/checkout/stripe_connect_spec.rb' - 'spec/serializers/enterprise_serializer_spec.rb' + - 'spec/services/order_syncer_spec.rb' + - 'spec/services/subscription_form_spec.rb' - 'spec/spec_helper.rb' - 'spec/support/cancan_helper.rb' - 'spec/support/request/authentication_workflow.rb' @@ -923,7 +929,7 @@ Layout/SpaceInsideStringInterpolation: - 'lib/open_food_network/users_and_enterprises_report.rb' - 'spec/support/request/web_helper.rb' -# Offense count: 6 +# Offense count: 5 # Cop supports --auto-correct. Layout/Tab: Exclude: @@ -932,7 +938,7 @@ Layout/Tab: - 'spec/lib/spree/product_filters_spec.rb' - 'spec/models/spree/line_item_spec.rb' -# Offense count: 67 +# Offense count: 62 # Cop supports --auto-correct. Layout/TrailingWhitespace: Exclude: @@ -946,7 +952,6 @@ Layout/TrailingWhitespace: - 'app/views/json/_enterprises.rabl' - 'app/views/json/_producer.rabl' - 'app/views/json/partials/_producer.rabl' - - 'lib/tasks/dev.rake' - 'spec/controllers/admin/column_preferences_controller_spec.rb' - 'spec/controllers/shop_controller_spec.rb' - 'spec/features/admin/enterprise_user_spec.rb' @@ -957,8 +962,6 @@ Layout/TrailingWhitespace: - 'spec/lib/open_food_network/order_grouper_spec.rb' - 'spec/lib/open_food_network/permissions_spec.rb' - 'spec/lib/open_food_network/user_balance_calculator_spec.rb' - - 'spec/models/order_cycle_spec.rb' - - 'spec/models/spree/product_spec.rb' - 'spec/models/spree/variant_spec.rb' - 'spec/serializers/admin/enterprise_serializer_spec.rb' - 'spec/serializers/enterprise_serializer_spec.rb' @@ -976,14 +979,6 @@ Lint/BlockAlignment: - 'spec/models/spree/line_item_spec.rb' - 'spec/models/spree/product_spec.rb' -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyleAlignWith, SupportedStylesAlignWith, AutoCorrect. -# SupportedStylesAlignWith: start_of_line, def -Lint/DefEndAlignment: - Exclude: - - 'app/models/spree/line_item_decorator.rb' - # Offense count: 1 # Cop supports --auto-correct. Lint/DeprecatedClassMethods: @@ -1002,7 +997,7 @@ Lint/EndAlignment: - 'app/serializers/api/admin/for_order_cycle/supplied_product_serializer.rb' - 'app/serializers/api/admin/order_cycle_serializer.rb' -# Offense count: 17 +# Offense count: 18 Lint/IneffectiveAccessModifier: Exclude: - 'app/models/column_preference.rb' @@ -1060,7 +1055,7 @@ Lint/UnderscorePrefixedVariableName: Exclude: - 'spec/support/cancan_helper.rb' -# Offense count: 126 +# Offense count: 128 # Cop supports --auto-correct. # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. Lint/UnusedBlockArgument: @@ -1095,12 +1090,11 @@ Lint/UnusedBlockArgument: - 'spec/support/matchers/table_matchers.rb' - 'spec/support/performance_helper.rb' -# Offense count: 16 +# Offense count: 15 # Cop supports --auto-correct. # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods. Lint/UnusedMethodArgument: Exclude: - - 'app/helpers/admin/injection_helper.rb' - 'app/helpers/angular_form_builder.rb' - 'app/helpers/angular_form_helper.rb' - 'app/helpers/order_cycles_helper.rb' @@ -1126,12 +1120,11 @@ Lint/UselessAccessModifier: - 'lib/open_food_network/reports/bulk_coop_report.rb' - 'spec/lib/open_food_network/reports/report_spec.rb' -# Offense count: 325 +# Offense count: 313 Lint/Void: Exclude: - 'app/serializers/api/enterprise_serializer.rb' - 'spec/archive/features/consumer/checkout_spec.rb' - - 'spec/controllers/admin/bulk_line_items_controller_spec.rb' - 'spec/controllers/api/order_cycles_controller_spec.rb' - 'spec/controllers/cart_controller_spec.rb' - 'spec/controllers/checkout_controller_spec.rb' @@ -1145,13 +1138,12 @@ Lint/Void: - 'spec/controllers/spree/orders_controller_spec.rb' - 'spec/controllers/user_passwords_controller_spec.rb' - 'spec/controllers/user_registrations_controller_spec.rb' + - 'spec/features/admin/bulk_product_update_spec.rb' - 'spec/features/admin/enterprise_fees_spec.rb' - 'spec/features/admin/enterprise_groups_spec.rb' - - 'spec/features/admin/enterprise_user_spec.rb' - 'spec/features/admin/enterprises/index_spec.rb' - 'spec/features/admin/enterprises_spec.rb' - 'spec/features/admin/order_cycles_spec.rb' - - 'spec/features/admin/orders_spec.rb' - 'spec/features/admin/payment_method_spec.rb' - 'spec/features/admin/product_import_spec.rb' - 'spec/features/admin/products_spec.rb' @@ -1173,7 +1165,6 @@ Lint/Void: - 'spec/lib/open_food_network/packing_report_spec.rb' - 'spec/lib/open_food_network/reports/report_spec.rb' - 'spec/lib/open_food_network/reports/rule_spec.rb' - - 'spec/mailers/enterprise_mailer_spec.rb' - 'spec/mailers/order_mailer_spec.rb' - 'spec/models/cart_spec.rb' - 'spec/models/enterprise_relationship_spec.rb' @@ -1192,12 +1183,10 @@ Lint/Void: - 'spec/serializers/enterprise_serializer_spec.rb' - 'spec/support/request/web_helper.rb' -# Offense count: 794 +# Offense count: 950 # Configuration parameters: CountComments, ExcludedMethods. Metrics/BlockLength: - Max: 672 - Exclude: - - 'spec/**/*' + Max: 773 # Offense count: 1 Performance/Caller: @@ -1248,7 +1237,7 @@ Performance/StringReplacement: - 'app/helpers/spree/admin/navigation_helper_decorator.rb' - 'app/models/spree/preferences/file_configuration.rb' -# Offense count: 10 +# Offense count: 11 # Cop supports --auto-correct. # Configuration parameters: NilOrEmpty, NotPresent, UnlessPresent. Rails/Blank: @@ -1279,10 +1268,11 @@ Rails/Delegate: - 'app/serializers/api/admin/tag_rule_serializer.rb' - 'app/serializers/api/variant_serializer.rb' -# Offense count: 7 +# Offense count: 8 Rails/FilePath: Exclude: - 'lib/tasks/karma.rake' + - 'spec/features/admin/bulk_product_update_spec.rb' - 'spec/features/admin/content_spec.rb' - 'spec/models/content_configuration_spec.rb' - 'spec/models/spree/image_spec.rb' @@ -1298,7 +1288,7 @@ Rails/FindEach: - 'app/models/enterprise.rb' - 'app/models/spree/user_decorator.rb' -# Offense count: 5 +# Offense count: 7 # Configuration parameters: Include. # Include: app/models/**/*.rb Rails/HasAndBelongsToMany: @@ -1347,7 +1337,7 @@ Rails/ReadWriteAttribute: Exclude: - 'app/models/enterprise.rb' -# Offense count: 46 +# Offense count: 45 # Configuration parameters: Include. # Include: app/models/**/*.rb Rails/ScopeArgs: @@ -1384,14 +1374,6 @@ Rails/TimeZone: - 'spec/models/enterprise_relationship_spec.rb' - 'spec/models/variant_override_spec.rb' -# Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, AutoCorrect. -# SupportedStyles: conservative, aggressive -Rails/UniqBeforePluck: - Exclude: - - 'lib/open_food_network/sales_tax_report.rb' - # Offense count: 21 # Cop supports --auto-correct. # Configuration parameters: Include. @@ -1448,7 +1430,7 @@ Style/BarePercentLiterals: - 'spec/features/admin/variants_spec.rb' - 'spec/support/request/web_helper.rb' -# Offense count: 207 +# Offense count: 209 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: braces, no_braces, context_dependent @@ -1482,10 +1464,10 @@ Style/BracesAroundHashParameters: - 'spec/controllers/admin/accounts_and_billing_settings_controller_spec.rb' - 'spec/controllers/admin/business_model_configuration_controller_spec.rb' - 'spec/controllers/admin/enterprises_controller_spec.rb' + - 'spec/controllers/admin/manager_invitations_controller_spec.rb' - 'spec/controllers/admin/order_cycles_controller_spec.rb' - 'spec/controllers/api/order_cycles_controller_spec.rb' - 'spec/controllers/cart_controller_spec.rb' - - 'spec/controllers/enterprise_confirmations_controller_spec.rb' - 'spec/controllers/enterprises_controller_spec.rb' - 'spec/controllers/line_items_controller_spec.rb' - 'spec/controllers/spree/admin/adjustments_controller_spec.rb' @@ -1497,6 +1479,7 @@ Style/BracesAroundHashParameters: - 'spec/controllers/spree/api/products_controller_spec.rb' - 'spec/controllers/spree/api/variants_controller_spec.rb' - 'spec/controllers/spree/orders_controller_spec.rb' + - 'spec/controllers/user_confirmations_controller_spec.rb' - 'spec/factories.rb' - 'spec/features/admin/accounts_and_billing_settings_spec.rb' - 'spec/features/admin/business_model_configuration_spec.rb' @@ -1509,6 +1492,7 @@ Style/BracesAroundHashParameters: - 'spec/jobs/update_account_invoices_spec.rb' - 'spec/lib/open_food_network/feature_toggle_spec.rb' - 'spec/lib/open_food_network/order_cycle_form_applicator_spec.rb' + - 'spec/lib/open_food_network/subscription_summarizer_spec.rb' - 'spec/lib/open_food_network/xero_invoices_report_spec.rb' - 'spec/models/billable_period_spec.rb' - 'spec/models/product_distribution_spec.rb' @@ -1650,8 +1634,8 @@ Style/ConditionalAssignment: - 'app/controllers/spree/admin/reports_controller_decorator.rb' - 'app/controllers/spree/admin/search_controller_decorator.rb' - 'app/helpers/spree/admin/orders_helper_decorator.rb' - - 'app/models/spree/calculator/flexi_rate_decorator.rb' - 'app/models/spree/calculator/per_item_decorator.rb' + - 'app/models/spree/line_item_decorator.rb' - 'app/models/spree/payment_decorator.rb' - 'spec/lib/open_food_network/order_grouper_spec.rb' @@ -1664,14 +1648,13 @@ Style/EachWithObject: - 'lib/open_food_network/enterprise_fee_calculator.rb' - 'lib/open_food_network/products_renderer.rb' -# Offense count: 2 +# Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles. # SupportedStyles: empty, nil, both Style/EmptyElse: Exclude: - 'app/models/spreadsheet_entry.rb' - - 'app/serializers/api/admin/basic_order_cycle_serializer.rb' # Offense count: 2 # Cop supports --auto-correct. @@ -1707,7 +1690,7 @@ Style/FileName: Style/FormatStringToken: EnforcedStyle: template -# Offense count: 87 +# Offense count: 88 # Configuration parameters: MinBodyLength. Style/GuardClause: Exclude: @@ -1727,7 +1710,6 @@ Style/GuardClause: - 'app/controllers/spree/admin/products_controller_decorator.rb' - 'app/controllers/spree/admin/resource_controller_decorator.rb' - 'app/controllers/spree/admin/shipping_methods_controller_decorator.rb' - - 'app/controllers/spree/admin/variants_controller_decorator.rb' - 'app/controllers/spree/orders_controller_decorator.rb' - 'app/controllers/spree/paypal_controller_decorator.rb' - 'app/jobs/products_cache_integrity_checker_job.rb' @@ -1759,7 +1741,7 @@ Style/GuardClause: - 'spec/support/request/distribution_helper.rb' - 'spec/support/request/shop_workflow.rb' -# Offense count: 1219 +# Offense count: 1109 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys @@ -1774,7 +1756,6 @@ Style/HashSyntax: - 'app/controllers/admin/tag_rules_controller.rb' - 'app/controllers/api/enterprises_controller.rb' - 'app/controllers/checkout_controller.rb' - - 'app/controllers/enterprise_confirmations_controller.rb' - 'app/controllers/open_food_network/cart_controller.rb' - 'app/controllers/spree/admin/line_items_controller_decorator.rb' - 'app/controllers/spree/admin/orders_controller_decorator.rb' @@ -1782,7 +1763,6 @@ Style/HashSyntax: - 'app/controllers/spree/admin/reports_controller_decorator.rb' - 'app/controllers/spree/admin/search_controller_decorator.rb' - 'app/controllers/spree/admin/shipping_methods_controller_decorator.rb' - - 'app/controllers/spree/admin/variants_controller_decorator.rb' - 'app/controllers/spree/api/products_controller_decorator.rb' - 'app/controllers/spree/orders_controller_decorator.rb' - 'app/controllers/spree/paypal_controller_decorator.rb' @@ -1796,7 +1776,6 @@ Style/HashSyntax: - 'app/helpers/spree/admin/navigation_helper_decorator.rb' - 'app/helpers/spree/admin/orders_helper_decorator.rb' - 'app/mailers/enterprise_mailer.rb' - - 'app/mailers/producer_mailer.rb' - 'app/mailers/spree/order_mailer_decorator.rb' - 'app/mailers/spree/user_mailer_decorator.rb' - 'app/models/billable_period.rb' @@ -1860,7 +1839,6 @@ Style/HashSyntax: - 'lib/spree/product_filters.rb' - 'lib/tasks/cache.rake' - 'lib/tasks/data.rake' - - 'lib/tasks/dev.rake' - 'lib/tasks/enterprises.rake' - 'lib/tasks/karma.rake' - 'spec/archive/features/consumer/checkout_spec.rb' @@ -1869,7 +1847,6 @@ Style/HashSyntax: - 'spec/controllers/api/order_cycles_controller_spec.rb' - 'spec/controllers/base_controller_spec.rb' - 'spec/controllers/cart_controller_spec.rb' - - 'spec/controllers/enterprise_confirmations_controller_spec.rb' - 'spec/controllers/spree/admin/orders_controller_spec.rb' - 'spec/controllers/spree/admin/payment_methods_controller_spec.rb' - 'spec/controllers/spree/admin/payments_controller_spec.rb' @@ -1893,10 +1870,12 @@ Style/HashSyntax: - 'spec/features/admin/products_spec.rb' - 'spec/features/admin/reports_spec.rb' - 'spec/features/admin/shipping_methods_spec.rb' + - 'spec/features/admin/subscriptions_spec.rb' - 'spec/features/admin/variant_overrides_spec.rb' - 'spec/features/consumer/account/cards_spec.rb' - 'spec/features/consumer/shopping/products_spec.rb' - 'spec/features/consumer/shopping/shopping_spec.rb' + - 'spec/jobs/subscription_placement_job_spec.rb' - 'spec/lib/open_food_network/group_buy_report_spec.rb' - 'spec/lib/open_food_network/lettuce_share_report_spec.rb' - 'spec/lib/open_food_network/order_and_distributor_report_spec.rb' @@ -1925,12 +1904,11 @@ Style/HashSyntax: - 'spec/support/request/web_helper.rb' - 'spec/support/seeds.rb' -# Offense count: 6 +# Offense count: 4 Style/IfInsideElse: Exclude: - 'app/controllers/admin/column_preferences_controller.rb' - 'app/controllers/admin/variant_overrides_controller.rb' - - 'app/controllers/enterprise_confirmations_controller.rb' - 'app/controllers/spree/admin/overview_controller_decorator.rb' - 'app/controllers/spree/admin/products_controller_decorator.rb' @@ -1990,23 +1968,22 @@ Style/MethodMissing: Exclude: - 'app/helpers/application_helper.rb' -# Offense count: 5 +# Offense count: 4 # Cop supports --auto-correct. Style/MultilineIfModifier: Exclude: - 'lib/open_food_network/enterprise_issue_validator.rb' - 'lib/spree/core/controller_helpers/respond_with_decorator.rb' -# Offense count: 7 +# Offense count: 6 # Cop supports --auto-correct. Style/MutableConstant: Exclude: - 'app/models/enterprise.rb' - 'app/models/enterprise_fee.rb' - - 'app/models/spree/payment_method_decorator.rb' - 'lib/discourse/single_sign_on.rb' -# Offense count: 8 +# Offense count: 7 # Cop supports --auto-correct. Style/NestedParenthesizedCalls: Exclude: @@ -2064,7 +2041,7 @@ Style/NumericLiteralPrefix: Style/NumericLiterals: MinDigits: 11 -# Offense count: 15 +# Offense count: 14 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect, EnforcedStyle, SupportedStyles. # SupportedStyles: predicate, comparison @@ -2158,11 +2135,10 @@ Style/RaiseArgs: - 'lib/open_food_network/products_renderer.rb' - 'spec/models/spree/tax_rate_spec.rb' -# Offense count: 3 +# Offense count: 2 # Cop supports --auto-correct. Style/RedundantBegin: Exclude: - - 'app/controllers/admin/order_cycles_controller.rb' - 'app/controllers/shop_controller.rb' - 'app/models/spree/product_decorator.rb' @@ -2196,7 +2172,7 @@ Style/RedundantReturn: - 'app/models/spree/order_populator_decorator.rb' - 'app/serializers/api/admin/enterprise_serializer.rb' -# Offense count: 110 +# Offense count: 114 # Cop supports --auto-correct. Style/RedundantSelf: Exclude: