From f8803888f21c5ff85e51d866b9d5f8a214f4de76 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Fri, 8 Nov 2019 18:58:13 +1100 Subject: [PATCH] Update Rubocop config to pass local run --- .rubocop_manual_todo.yml | 70 +++++++++- .rubocop_styleguide.yml | 1 + .rubocop_todo.yml | 213 ++++++++++++++++++------------ lib/tasks/users.rake | 4 +- spec/lib/tasks/users_rake_spec.rb | 2 +- 5 files changed, 200 insertions(+), 90 deletions(-) diff --git a/.rubocop_manual_todo.yml b/.rubocop_manual_todo.yml index 0e68fdf05e..d5a64720cb 100644 --- a/.rubocop_manual_todo.yml +++ b/.rubocop_manual_todo.yml @@ -14,8 +14,7 @@ # rubocop > rubo.log # # inspect log file to see which cops are failing # # copy cop configurations and add Exclude parameter -# grep ExampleCop rubo.log | cut -d ":" -f 1 | sort -u >> .rubocop.yml -# # use vim to add `- ` before each line +# grep ExampleCop rubo.log | cut -d ":" -f 1 | sort -u | while read f; do echo " - $f"; done >> .rubocop.yml # # This process probably doesn't need repeating. Otherwise there is plenty # of room for improvements and automation. @@ -354,6 +353,27 @@ Metrics/LineLength: - spec/support/request/shop_workflow.rb - spec/support/request/web_helper.rb - spec/support/seeds.rb + - app/models/spree/user.rb + - spec/controllers/api/base_controller_spec.rb + - spec/controllers/api/products_controller_spec.rb + - spec/controllers/api/shipments_controller_spec.rb + - spec/controllers/api/variants_controller_spec.rb + - spec/controllers/spree/admin/products_controller_spec.rb + - spec/features/admin/users_spec.rb + - spec/lib/open_food_network/order_cycle_management_report_spec.rb + - spec/models/calculator/weight_spec.rb + - spec/models/spree/product_set_spec.rb + - spec/serializers/api/admin/customer_serializer_spec.rb + - spec/serializers/api/admin/exchange_serializer_spec.rb + - spec/serializers/api/admin/for_order_cycle/enterprise_serializer_spec.rb + - spec/serializers/api/admin/for_order_cycle/supplied_product_serializer_spec.rb + - spec/serializers/api/admin/subscription_customer_serializer_spec.rb + - spec/serializers/api/admin/variant_override_serializer_spec.rb + - spec/serializers/api/current_order_serializer_spec.rb + - spec/serializers/api/order_serializer_spec.rb + - spec/services/order_cycle_distributed_products_spec.rb + - spec/services/products_renderer_spec.rb + - spec/services/product_tag_rules_filterer_spec.rb Metrics/AbcSize: Max: 15 @@ -459,6 +479,22 @@ Metrics/AbcSize: - spec/models/enterprise_spec.rb - spec/models/product_importer_spec.rb - spec/support/performance_helper.rb + - app/controllers/api/products_controller.rb + - app/controllers/api/shipments_controller.rb + - app/controllers/api/taxons_controller.rb + - app/controllers/api/variants_controller.rb + - app/controllers/spree/admin/image_settings_controller.rb + - app/controllers/spree/admin/taxons_controller.rb + - app/controllers/spree/admin/users_controller.rb + - app/controllers/spree/checkout_controller.rb + - app/controllers/spree/orders_controller.rb + - app/controllers/spree/user_passwords_controller.rb + - app/controllers/spree/user_registrations_controller.rb + - app/controllers/spree/users_controller.rb + - app/controllers/spree/user_sessions_controller.rb + - lib/spree/api/controller_setup.rb + - spec/features/consumer/shopping/checkout_paypal_spec.rb + - spec/services/restart_checkout_spec.rb Metrics/BlockLength: Max: 25 @@ -479,7 +515,14 @@ Metrics/BlockLength: - lib/tasks/data.rake - lib/tasks/dev.rake - spec/controllers/spree/admin/invoices_controller_spec.rb + - spec/factories.rb + - spec/factories/enterprise_factory.rb + - spec/factories/order_cycle_factory.rb + - spec/factories/shipping_method_factory.rb + - spec/factories/order_factory.rb + - spec/factories/subscription_factory.rb - spec/factories/variant_factory.rb + - spec/factories/product_factory.rb - spec/features/admin/orders_spec.rb - spec/features/consumer/shopping/embedded_shopfronts_spec.rb - spec/lib/open_food_network/group_buy_report_spec.rb @@ -517,6 +560,8 @@ Metrics/CyclomaticComplexity: - lib/spree/core/controller_helpers/respond_with_decorator.rb - lib/spree/localized_number.rb - spec/models/product_importer_spec.rb + - app/controllers/spree/admin/taxons_controller.rb + - app/controllers/spree/orders_controller.rb Metrics/PerceivedComplexity: Max: 7 @@ -541,6 +586,9 @@ Metrics/PerceivedComplexity: - lib/spree/core/controller_helpers/respond_with_decorator.rb - lib/spree/localized_number.rb - spec/models/product_importer_spec.rb + - app/controllers/api/variants_controller.rb + - app/controllers/spree/admin/taxons_controller.rb + - app/controllers/spree/orders_controller.rb Metrics/MethodLength: Max: 10 @@ -625,6 +673,19 @@ Metrics/MethodLength: - spec/features/consumer/shopping/variant_overrides_spec.rb - spec/models/product_importer_spec.rb - spec/support/request/authentication_workflow.rb + - app/controllers/api/products_controller.rb + - app/controllers/api/shipments_controller.rb + - app/controllers/api/taxons_controller.rb + - app/controllers/api/variants_controller.rb + - app/controllers/spree/admin/image_settings_controller.rb + - app/controllers/spree/admin/tax_categories_controller.rb + - app/controllers/spree/admin/taxons_controller.rb + - app/controllers/spree/admin/users_controller.rb + - app/controllers/spree/orders_controller.rb + - app/controllers/spree/user_registrations_controller.rb + - app/controllers/spree/user_sessions_controller.rb + - lib/spree/api/controller_setup.rb + - spec/features/consumer/shopping/checkout_paypal_spec.rb Metrics/ClassLength: Max: 100 @@ -653,6 +714,10 @@ Metrics/ClassLength: - lib/open_food_network/permissions.rb - lib/open_food_network/products_cache.rb - lib/open_food_network/xero_invoices_report.rb + - app/controllers/api/products_controller.rb + - app/controllers/spree/admin/users_controller.rb + - app/controllers/spree/orders_controller.rb + - app/models/spree/user.rb Metrics/ModuleLength: Max: 100 @@ -685,6 +750,7 @@ Metrics/ModuleLength: - spec/models/spree/product_spec.rb - spec/models/spree/variant_spec.rb - spec/support/request/web_helper.rb + - app/helpers/injection_helper.rb Metrics/ParameterLists: Max: 5 diff --git a/.rubocop_styleguide.yml b/.rubocop_styleguide.yml index 52e0fe5ba0..c1fa89c3f8 100644 --- a/.rubocop_styleguide.yml +++ b/.rubocop_styleguide.yml @@ -8,6 +8,7 @@ AllCops: TargetRubyVersion: 2.1 TargetRailsVersion: 3.2 Exclude: + - 'bin/**/*' - 'db/**/*' - 'config/**/*' - 'script/**/*' diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 712ceee1da..af6f3bcc01 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,11 +1,21 @@ # This configuration was generated by # `rubocop --auto-gen-config --exclude-limit 1400` -# on 2019-07-23 14:09:18 +0100 using RuboCop version 0.57.2. +# on 2019-11-08 18:54:42 +1100 using RuboCop version 0.57.2. # 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: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. +# SupportedHashRocketStyles: key, separator, table +# SupportedColonStyles: key, separator, table +# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit +Layout/AlignHash: + Exclude: + - 'spec/mailers/order_mailer_spec.rb' + # Offense count: 1 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyleAlignWith, AutoCorrect, Severity. @@ -14,17 +24,32 @@ Layout/DefEndAlignment: Exclude: - 'app/models/order_updater.rb' -# Offense count: 4 +# Offense count: 2 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: empty_lines, no_empty_lines +Layout/EmptyLinesAroundBlockBody: + Exclude: + - 'spec/serializers/api/admin/variant_serializer_spec.rb' + - 'spec/services/product_tag_rules_filterer_spec.rb' + +# Offense count: 3 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyleAlignWith, AutoCorrect, Severity. # SupportedStylesAlignWith: keyword, variable, start_of_line Layout/EndAlignment: Exclude: - 'app/controllers/admin/order_cycles_controller.rb' - - 'app/controllers/api/order_cycles_controller.rb' - 'app/serializers/api/admin/for_order_cycle/supplied_product_serializer.rb' - 'app/serializers/api/admin/order_cycle_serializer.rb' +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment. +Layout/ExtraSpacing: + Exclude: + - 'spec/services/order_syncer_spec.rb' + # Offense count: 2 # Cop supports --auto-correct. # Configuration parameters: IndentationWidth. @@ -32,6 +57,41 @@ Layout/EndAlignment: Layout/IndentHash: EnforcedStyle: consistent +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: AllowForAlignment. +Layout/SpaceAroundOperators: + Exclude: + - 'spec/services/order_syncer_spec.rb' + +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters. +# SupportedStyles: space, no_space +# SupportedStylesForEmptyBraces: space, no_space +Layout/SpaceInsideBlockBraces: + Exclude: + - 'spec/services/embedded_page_service_spec.rb' + +# Offense count: 6 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces. +# SupportedStyles: space, no_space, compact +# SupportedStylesForEmptyBraces: space, no_space +Layout/SpaceInsideHashLiteralBraces: + Exclude: + - 'spec/controllers/api/products_controller_spec.rb' + - 'spec/serializers/api/product_serializer_spec.rb' + +# Offense count: 4 +# Cop supports --auto-correct. +# Configuration parameters: AllowInHeredoc. +Layout/TrailingWhitespace: + Exclude: + - 'spec/controllers/api/taxons_controller_spec.rb' + - 'spec/features/admin/bulk_product_update_spec.rb' + - 'spec/serializers/api/admin/subscription_line_item_serializer_spec.rb' + # Offense count: 4 Lint/AmbiguousOperator: Exclude: @@ -46,10 +106,16 @@ Lint/DuplicateMethods: - 'lib/discourse/single_sign_on.rb' - 'lib/open_food_network/subscription_summary.rb' -# Offense count: 8 +# Offense count: 1 +Lint/DuplicatedKey: + Exclude: + - 'spec/models/calculator/weight_spec.rb' + +# Offense count: 10 Lint/IneffectiveAccessModifier: Exclude: - 'app/models/column_preference.rb' + - 'app/models/spree/user.rb' - 'app/services/mail_configuration.rb' - 'lib/open_food_network/feature_toggle.rb' - 'spec/lib/open_food_network/reports/report_spec.rb' @@ -86,51 +152,16 @@ Lint/UselessAccessModifier: - 'lib/open_food_network/reports/bulk_coop_report.rb' - 'spec/lib/open_food_network/reports/report_spec.rb' -# Offense count: 8 +# Offense count: 1 # Configuration parameters: CheckForMethodsWithNoSideEffects. Lint/Void: Exclude: - 'app/serializers/api/enterprise_serializer.rb' - - 'spec/features/admin/bulk_product_update_spec.rb' - - 'spec/features/consumer/shopping/checkout_spec.rb' - - 'spec/features/consumer/shopping/shopping_spec.rb' - - 'spec/features/consumer/shopping/variant_overrides_spec.rb' - -# Offense count: 15 -Metrics/AbcSize: - Max: 36 - -# Offense count: 13 -# Configuration parameters: CountComments, ExcludedMethods. -Metrics/BlockLength: - Max: 115 - -# Offense count: 2 -# Configuration parameters: CountComments. -Metrics/ClassLength: - Max: 169 - -# Offense count: 1 -Metrics/CyclomaticComplexity: - Max: 8 # Offense count: 8 -# Configuration parameters: CountComments. -Metrics/MethodLength: - Max: 31 - -# Offense count: 2 -# Configuration parameters: CountComments. -Metrics/ModuleLength: - Max: 208 - -# Offense count: 2 -Metrics/PerceivedComplexity: - Max: 11 - -# Offense count: 7 Naming/AccessorMethodName: Exclude: + - 'app/controllers/spree/admin/taxonomies_controller.rb' - 'app/models/spree/adjustment_decorator.rb' - 'app/models/spree/order_decorator.rb' - 'spec/support/request/shop_workflow.rb' @@ -209,6 +240,12 @@ Performance/Caller: Exclude: - 'app/controllers/application_controller.rb' +# Offense count: 3 +# Cop supports --auto-correct. +Performance/InefficientHashSearch: + Exclude: + - 'spec/controllers/api/products_controller_spec.rb' + # Offense count: 1 # Configuration parameters: EnforcedStyle. # SupportedStyles: strict, flexible @@ -216,7 +253,14 @@ Rails/Date: Exclude: - 'app/models/order_cycle.rb' -# Offense count: 8 +# Offense count: 3 +# Cop supports --auto-correct. +# Configuration parameters: EnforceForPrefixed. +Rails/Delegate: + Exclude: + - 'lib/spree/authentication_helpers.rb' + +# Offense count: 7 # Configuration parameters: EnforcedStyle. # SupportedStyles: slashes, arguments Rails/FilePath: @@ -225,7 +269,6 @@ Rails/FilePath: - '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' - 'spec/models/spree/variant_spec.rb' - 'spec/spec_helper.rb' @@ -241,7 +284,7 @@ Rails/HasAndBelongsToMany: - 'app/models/spree/concerns/payment_method_distributors.rb' - 'app/models/spree/line_item_decorator.rb' -# Offense count: 25 +# Offense count: 26 # Configuration parameters: Include. # Include: app/models/**/*.rb Rails/HasManyOrHasOneDependent: @@ -254,10 +297,19 @@ Rails/HasManyOrHasOneDependent: - 'app/models/spree/payment_method_decorator.rb' - 'app/models/spree/property_decorator.rb' - 'app/models/spree/shipping_method_decorator.rb' - - 'app/models/spree/user_decorator.rb' + - 'app/models/spree/user.rb' - 'app/models/spree/variant_decorator.rb' - 'app/models/subscription.rb' +# Offense count: 9 +# Cop supports --auto-correct. +# Configuration parameters: EnforcedStyle. +# SupportedStyles: numeric, symbolic +Rails/HttpStatus: + Exclude: + - 'app/controllers/api/products_controller.rb' + - 'app/controllers/api/variants_controller.rb' + # Offense count: 6 Rails/OutputSafety: Exclude: @@ -268,7 +320,7 @@ Rails/OutputSafety: - 'lib/spree/money_decorator.rb' - 'spec/features/admin/orders_spec.rb' -# Offense count: 15 +# Offense count: 11 # Configuration parameters: EnforcedStyle. # SupportedStyles: strict, flexible Rails/TimeZone: @@ -279,8 +331,6 @@ Rails/TimeZone: - 'lib/open_food_network/users_and_enterprises_report.rb' - 'spec/controllers/api/statuses_controller_spec.rb' - 'spec/jobs/heartbeat_job_spec.rb' - - 'spec/lib/open_food_network/products_cache_refreshment_spec.rb' - - 'spec/lib/open_food_network/products_cache_spec.rb' - 'spec/models/enterprise_relationship_spec.rb' # Offense count: 1 @@ -304,7 +354,7 @@ Style/CaseEquality: - 'app/helpers/angular_form_helper.rb' - 'spec/models/spree/payment_spec.rb' -# Offense count: 78 +# Offense count: 76 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect, EnforcedStyle. # SupportedStyles: nested, compact @@ -400,21 +450,15 @@ Style/CommentedKeyword: # SupportedStyles: assign_to_condition, assign_inside_condition Style/ConditionalAssignment: Exclude: - - 'app/controllers/spree/api/products_controller.rb' - - 'app/controllers/spree/api/taxons_controller.rb' - - 'app/controllers/spree/api/variants_controller.rb' + - 'app/controllers/api/taxons_controller.rb' + - 'app/controllers/api/variants_controller.rb' + - 'app/controllers/spree/admin/taxons_controller.rb' # Offense count: 2 Style/DateTime: Exclude: - 'lib/open_food_network/users_and_enterprises_report.rb' -# Offense count: 1 -# Cop supports --auto-correct. -Style/EachWithObject: - Exclude: - - 'app/controllers/spree/api/base_controller.rb' - # Offense count: 5 # Configuration parameters: EnforcedStyle. # SupportedStyles: annotated, template, unannotated @@ -424,7 +468,7 @@ Style/FormatStringToken: - 'lib/open_food_network/sales_tax_report.rb' - 'spec/models/enterprise_spec.rb' -# Offense count: 68 +# Offense count: 61 # Configuration parameters: MinBodyLength. Style/GuardClause: Exclude: @@ -438,27 +482,22 @@ Style/GuardClause: - 'app/controllers/spree/admin/adjustments_controller_decorator.rb' - 'app/controllers/spree/admin/base_controller_decorator.rb' - 'app/controllers/spree/admin/orders_controller_decorator.rb' - - 'app/controllers/spree/admin/products_controller_decorator.rb' - 'app/controllers/spree/admin/resource_controller_decorator.rb' - 'app/controllers/spree/admin/variants_controller_decorator.rb' - - 'app/controllers/spree/api/base_controller.rb' - 'app/controllers/spree/checkout_controller.rb' - 'app/controllers/spree/orders_controller.rb' - 'app/controllers/spree/paypal_controller_decorator.rb' - - 'app/jobs/products_cache_integrity_checker_job.rb' - 'app/models/enterprise.rb' - 'app/models/enterprise_group.rb' - 'app/models/producer_property.rb' - 'app/models/spree/classification_decorator.rb' - 'app/models/spree/order_decorator.rb' - - 'app/models/spree/preference_decorator.rb' + - 'app/models/spree/price_decorator.rb' - 'app/models/spree/product_decorator.rb' - - 'app/models/spree/user_decorator.rb' - 'app/services/advance_order_service.rb' - 'app/services/order_syncer.rb' - 'lib/discourse/single_sign_on.rb' - 'lib/open_food_network/order_cycle_form_applicator.rb' - - 'lib/open_food_network/products_renderer.rb' - 'lib/open_food_network/rack_request_blocker.rb' - 'lib/open_food_network/variant_and_line_item_naming.rb' - 'lib/spree/core/controller_helpers/order_decorator.rb' @@ -467,23 +506,25 @@ Style/GuardClause: - 'spec/support/request/distribution_helper.rb' - 'spec/support/request/shop_workflow.rb' -# Offense count: 6 +# Offense count: 9 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys Style/HashSyntax: Exclude: - - 'app/controllers/spree/api/base_controller.rb' + - 'app/controllers/spree/admin/resource_controller_decorator.rb' + - 'app/controllers/spree/admin/taxonomies_controller.rb' - 'app/controllers/spree/checkout_controller.rb' - 'app/controllers/spree/orders_controller.rb' + - 'spec/features/admin/users_spec.rb' # Offense count: 4 Style/IfInsideElse: Exclude: - 'app/controllers/admin/column_preferences_controller.rb' - 'app/controllers/admin/variant_overrides_controller.rb' + - 'app/controllers/api/taxons_controller.rb' - 'app/controllers/spree/admin/products_controller_decorator.rb' - - 'app/controllers/spree/api/taxons_controller.rb' # Offense count: 1 Style/MissingRespondToMissing: @@ -499,13 +540,7 @@ Style/MixinUsage: - 'spec/lib/open_food_network/order_cycle_management_report_spec.rb' - 'spec/lib/open_food_network/packing_report_spec.rb' -# Offense count: 2 -Style/NestedTernaryOperator: - Exclude: - - 'app/views/spree/api/products/bulk_show.v1.rabl' - - 'app/views/spree/api/variants/bulk_show.v1.rabl' - -# Offense count: 10 +# Offense count: 9 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect, EnforcedStyle. # SupportedStyles: predicate, comparison @@ -516,12 +551,17 @@ Style/NumericPredicate: - 'app/models/spree/calculator/flexi_rate_decorator.rb' - 'app/models/spree/line_item_decorator.rb' - 'app/models/spree/order_decorator.rb' - - 'lib/open_food_network/integrity_checker.rb' - 'lib/open_food_network/rack_request_blocker.rb' - 'lib/open_food_network/xero_invoices_report.rb' - 'lib/spree/money_decorator.rb' -# Offense count: 15 +# Offense count: 1 +# Cop supports --auto-correct. +Style/RedundantParentheses: + Exclude: + - 'spec/controllers/api/variants_controller_spec.rb' + +# Offense count: 14 # Cop supports --auto-correct. # Configuration parameters: EnforcedStyle, AllowInnerSlashes. # SupportedStyles: slashes, percent_r, mixed @@ -531,19 +571,17 @@ Style/RegexpLiteral: - 'app/helpers/html_helper.rb' - 'app/models/enterprise.rb' - 'app/models/enterprise_group.rb' - - 'app/models/spree/preference_decorator.rb' - 'lib/discourse/single_sign_on.rb' - 'spec/mailers/subscription_mailer_spec.rb' - 'spec/models/content_configuration_spec.rb' -# Offense count: 244 +# Offense count: 235 Style/Send: Exclude: - 'app/controllers/spree/checkout_controller.rb' - 'app/models/spree/shipping_method_decorator.rb' - 'spec/controllers/admin/subscriptions_controller_spec.rb' - 'spec/controllers/checkout_controller_spec.rb' - - 'spec/controllers/shop_controller_spec.rb' - 'spec/controllers/spree/admin/base_controller_spec.rb' - 'spec/controllers/spree/orders_controller_spec.rb' - 'spec/helpers/order_cycles_helper_spec.rb' @@ -557,20 +595,18 @@ Style/Send: - 'spec/lib/open_food_network/order_cycle_form_applicator_spec.rb' - 'spec/lib/open_food_network/permissions_spec.rb' - 'spec/lib/open_food_network/products_and_inventory_report_spec.rb' - - 'spec/lib/open_food_network/products_cache_spec.rb' - - 'spec/lib/open_food_network/products_renderer_spec.rb' - 'spec/lib/open_food_network/sales_tax_report_spec.rb' - 'spec/lib/open_food_network/subscription_payment_updater_spec.rb' - 'spec/lib/open_food_network/subscription_summarizer_spec.rb' - 'spec/lib/open_food_network/tag_rule_applicator_spec.rb' - 'spec/lib/open_food_network/xero_invoices_report_spec.rb' - 'spec/lib/stripe/webhook_handler_spec.rb' + - 'spec/models/calculator/weight_spec.rb' - 'spec/models/enterprise_spec.rb' - 'spec/models/exchange_spec.rb' - 'spec/models/spree/gateway/stripe_connect_spec.rb' - 'spec/models/spree/order_spec.rb' - 'spec/models/spree/payment_spec.rb' - - 'spec/models/spree/preference_spec.rb' - 'spec/models/spree/tax_rate_spec.rb' - 'spec/models/tag_rule/discount_order_spec.rb' - 'spec/models/tag_rule/filter_order_cycles_spec.rb' @@ -578,6 +614,7 @@ Style/Send: - 'spec/models/tag_rule/filter_products_spec.rb' - 'spec/models/tag_rule/filter_shipping_methods_spec.rb' - 'spec/services/cart_service_spec.rb' + - 'spec/services/products_renderer_spec.rb' - 'spec/spec_helper.rb' - 'spec/support/localized_number_helper.rb' - 'spec/support/matchers/delegate_matchers.rb' @@ -587,8 +624,16 @@ Style/StructInheritance: Exclude: - 'lib/open_food_network/enterprise_fee_applicator.rb' +# Offense count: 1 +# Cop supports --auto-correct. +# Configuration parameters: IgnoredMethods. +# IgnoredMethods: respond_to, define_method +Style/SymbolProc: + Exclude: + - 'spec/features/admin/orders_spec.rb' + # Offense count: 1 # Cop supports --auto-correct. Style/UnlessElse: Exclude: - - 'app/controllers/spree/api/variants_controller.rb' + - 'app/controllers/api/variants_controller.rb' diff --git a/lib/tasks/users.rake b/lib/tasks/users.rake index 38f888968d..30f76f9449 100644 --- a/lib/tasks/users.rake +++ b/lib/tasks/users.rake @@ -7,9 +7,7 @@ namespace :ofn do end class RemoveEnterpriseLimit - # rubocop:disable Style/NumericLiterals - MAX_INTEGER = 2147483647 - # rubocop:enable Style/NumericLiterals + MAX_INTEGER = 2_147_483_647 def initialize(user_id) @user_id = user_id diff --git a/spec/lib/tasks/users_rake_spec.rb b/spec/lib/tasks/users_rake_spec.rb index 46a6711944..a1876e79f3 100644 --- a/spec/lib/tasks/users_rake_spec.rb +++ b/spec/lib/tasks/users_rake_spec.rb @@ -8,7 +8,7 @@ describe 'users.rake' do Rake.application.rake_require 'tasks/users' Rake::Task.define_task(:environment) - max_integer = 2147483647 + max_integer = 2_147_483_647 user = create(:user) Rake.application.invoke_task "ofn:remove_enterprise_limit[#{user.id}]"