From a8cd049b1cf276f9a06ec20d69fd59a51ec0db99 Mon Sep 17 00:00:00 2001 From: Rubocop Challenger Date: Fri, 9 Feb 2024 23:31:42 +0000 Subject: [PATCH 1/3] :police_car: regenerate rubocop todo --- .rubocop_todo.yml | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index ae394a82..00553da7 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by -# `rubocop --auto-gen-config --exclude-limit 200` -# on 2023-10-11 12:02:42 UTC using RuboCop version 1.57.0. +# `rubocop --auto-gen-config --exclude-limit 180` +# on 2024-02-09 23:31:40 UTC using RuboCop version 1.60.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 @@ -154,7 +154,7 @@ Layout/EmptyLineBetweenDefs: - 'spec/dummy/app/controllers/pets_using_auto_views_controller.rb' - 'spec/dummy/app/controllers/pets_using_self_describing_classes_controller.rb' -# Offense count: 56 +# Offense count: 55 # This cop supports safe autocorrection (--autocorrect). Layout/EmptyLines: Exclude: @@ -192,7 +192,7 @@ Layout/EmptyLinesAroundAttributeAccessor: Exclude: - 'lib/apipie/configuration.rb' -# Offense count: 92 +# Offense count: 91 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: empty_lines, no_empty_lines @@ -213,7 +213,6 @@ Layout/EmptyLinesAroundBlockBody: - 'spec/lib/apipie/extractor/writer_spec.rb' - 'spec/lib/apipie/file_handler_spec.rb' - 'spec/lib/apipie/generator/swagger/param_description/composite_spec.rb' - - 'spec/lib/apipie/generator/swagger/param_description/type_spec.rb' - 'spec/lib/apipie/param_description_spec.rb' - 'spec/lib/apipie/param_group_spec.rb' - 'spec/lib/apipie/validator_spec.rb' @@ -454,7 +453,7 @@ Layout/SpaceAfterColon: Exclude: - 'spec/dummy/app/controllers/included_param_group_controller.rb' -# Offense count: 42 +# Offense count: 41 # This cop supports safe autocorrection (--autocorrect). Layout/SpaceAfterComma: Exclude: @@ -490,8 +489,9 @@ Layout/SpaceAfterNot: # Offense count: 142 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator. +# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator, EnforcedStyleForRationalLiterals. # SupportedStylesForExponentOperator: space, no_space +# SupportedStylesForRationalLiterals: space, no_space Layout/SpaceAroundOperators: Exclude: - 'app/controllers/apipie/apipies_controller.rb' @@ -726,21 +726,18 @@ Lint/UnderscorePrefixedVariableName: - 'lib/apipie/application.rb' - 'lib/apipie/dsl_definition.rb' -# Offense count: 26 +# Offense count: 22 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. Lint/UnusedBlockArgument: Exclude: - 'lib/apipie/configuration.rb' - - 'lib/apipie/extractor/collector.rb' - - 'lib/apipie/extractor/recorder.rb' - 'lib/apipie/param_description.rb' - 'lib/apipie/resource_description.rb' - 'lib/apipie/rspec/response_validation_helper.rb' - 'lib/tasks/apipie.rake' - 'spec/controllers/users_controller_spec.rb' - 'spec/lib/apipie/apipies_controller_spec.rb' - - 'spec/lib/apipie/extractor_spec.rb' - 'spec/lib/swagger/swagger_dsl_spec.rb' - 'spec/spec_helper.rb' @@ -802,7 +799,7 @@ Metrics/MethodLength: Metrics/ModuleLength: Max: 119 -# Offense count: 4 +# Offense count: 5 # Configuration parameters: CountKeywordArgs. Metrics/ParameterLists: MaxOptionalParameters: 5 @@ -974,7 +971,7 @@ RSpec/BeforeAfterAll: Exclude: - 'spec/controllers/users_controller_spec.rb' -# Offense count: 53 +# Offense count: 54 # Configuration parameters: Prefixes, AllowedPatterns. # Prefixes: when, with, without RSpec/ContextWording: @@ -1141,7 +1138,7 @@ RSpec/MessageSpies: RSpec/MultipleExpectations: Max: 19 -# Offense count: 160 +# Offense count: 163 # Configuration parameters: AllowSubject. RSpec/MultipleMemoizedHelpers: Max: 15 @@ -1166,7 +1163,7 @@ RSpec/NamedSubject: - 'spec/lib/swagger/rake_swagger_spec.rb' - 'spec/lib/swagger/swagger_dsl_spec.rb' -# Offense count: 96 +# Offense count: 97 # Configuration parameters: AllowedGroups. RSpec/NestedGroups: Max: 6 @@ -1293,7 +1290,7 @@ Rails/NegateInclude: - 'lib/apipie/extractor/writer.rb' - 'spec/spec_helper.rb' -# Offense count: 7 +# Offense count: 6 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Include. # Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb @@ -1921,7 +1918,7 @@ Style/StringConcatenation: - 'lib/apipie/application.rb' - 'lib/apipie/extractor/writer.rb' -# Offense count: 1214 +# Offense count: 1229 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. # SupportedStyles: single_quotes, double_quotes @@ -2021,7 +2018,7 @@ Style/TrailingCommaInArrayLiteral: - 'spec/controllers/users_controller_spec.rb' - 'spec/dummy/app/controllers/pets_using_self_describing_classes_controller.rb' -# Offense count: 4 +# Offense count: 5 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyleForMultiline. # SupportedStylesForMultiline: comma, consistent_comma, no_comma From f38a9d0a9253a35ebf0e9d3133d57b977b5b09f9 Mon Sep 17 00:00:00 2001 From: Rubocop Challenger Date: Fri, 9 Feb 2024 23:31:48 +0000 Subject: [PATCH 2/3] :police_car: Layout/FirstArrayElementIndentation --- .rubocop_todo.yml | 8 ----- spec/dummy/app/controllers/pets_controller.rb | 8 ++--- ...sing_self_describing_classes_controller.rb | 32 +++++++++---------- 3 files changed, 20 insertions(+), 28 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 00553da7..e62203bd 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -313,14 +313,6 @@ Layout/ExtraSpacing: - 'spec/lib/apipie/generator/swagger/param_description/type_spec.rb' - 'spec/lib/swagger/swagger_dsl_spec.rb' -# Offense count: 9 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, IndentationWidth. -# SupportedStyles: special_inside_parentheses, consistent, align_brackets -Layout/FirstArrayElementIndentation: - Exclude: - - 'spec/dummy/app/controllers/pets_controller.rb' - - 'spec/dummy/app/controllers/pets_using_self_describing_classes_controller.rb' # Offense count: 38 # This cop supports safe autocorrection (--autocorrect). diff --git a/spec/dummy/app/controllers/pets_controller.rb b/spec/dummy/app/controllers/pets_controller.rb index 7935215c..b5bc439c 100644 --- a/spec/dummy/app/controllers/pets_controller.rb +++ b/spec/dummy/app/controllers/pets_controller.rb @@ -364,8 +364,8 @@ def returns_response_with_valid_array result = { a_number: 3, array_of_objects: [ - {number1: 1, number2: 2}, - {number1: 10, number2: 20} + {number1: 1, number2: 2}, + {number1: 10, number2: 20} ] } render :json => result @@ -387,8 +387,8 @@ def returns_response_with_invalid_array result = { a_number: 3, array_of_objects: [ - {number1: 1, number2: 2}, - {number1: 10, number2: "this should have been a number"} + {number1: 1, number2: 2}, + {number1: 10, number2: "this should have been a number"} ] } render :json => result diff --git a/spec/dummy/app/controllers/pets_using_self_describing_classes_controller.rb b/spec/dummy/app/controllers/pets_using_self_describing_classes_controller.rb index 0252906b..ca4a085d 100644 --- a/spec/dummy/app/controllers/pets_using_self_describing_classes_controller.rb +++ b/spec/dummy/app/controllers/pets_using_self_describing_classes_controller.rb @@ -13,9 +13,9 @@ class Pet def self.describe_own_properties [ - Apipie::prop(:pet_name, 'string', {:description => 'Name of pet', :required => false}), - Apipie::prop(:animal_type, 'string', {:description => 'Type of pet', :values => %w[dog cat iguana kangaroo]}), - Apipie::additional_properties(false) + Apipie::prop(:pet_name, 'string', {:description => 'Name of pet', :required => false}), + Apipie::prop(:animal_type, 'string', {:description => 'Type of pet', :values => %w[dog cat iguana kangaroo]}), + Apipie::additional_properties(false) ] end end @@ -26,14 +26,14 @@ def self.describe_own_properties class PetWithMeasurements def self.describe_own_properties [ - Apipie::prop(:pet_name, 'string', {:description => 'Name of pet', :required => false}), - Apipie::prop('animal_type', 'string', {:description => 'Type of pet', :values => %w[dog cat iguana kangaroo]}), - Apipie::prop(:pet_measurements, 'object', {}, [ - Apipie::prop(:weight, 'number', {:description => "Weight in pounds" }), - Apipie::prop(:height, 'number', {:description => "Height in inches" }), - Apipie::prop(:num_legs, 'number', {:description => "Number of legs", :required => false }), - Apipie::additional_properties(false) - ]) + Apipie::prop(:pet_name, 'string', {:description => 'Name of pet', :required => false}), + Apipie::prop('animal_type', 'string', {:description => 'Type of pet', :values => %w[dog cat iguana kangaroo]}), + Apipie::prop(:pet_measurements, 'object', {}, [ + Apipie::prop(:weight, 'number', {:description => "Weight in pounds" }), + Apipie::prop(:height, 'number', {:description => "Height in inches" }), + Apipie::prop(:num_legs, 'number', {:description => "Number of legs", :required => false }), + Apipie::additional_properties(false) + ]) ] end end @@ -44,11 +44,11 @@ def self.describe_own_properties class PetWithManyMeasurements def self.describe_own_properties [ - Apipie::prop(:pet_name, 'string', {:description => 'Name of pet', :required => false}), - Apipie::prop(:many_pet_measurements, 'object', {is_array: true}, [ - Apipie::prop(:weight, 'number', {:description => "Weight in pounds" }), - Apipie::prop(:height, 'number', {:description => "Height in inches" }), - ]) + Apipie::prop(:pet_name, 'string', {:description => 'Name of pet', :required => false}), + Apipie::prop(:many_pet_measurements, 'object', {is_array: true}, [ + Apipie::prop(:weight, 'number', {:description => "Weight in pounds" }), + Apipie::prop(:height, 'number', {:description => "Height in inches" }), + ]) ] end end From b6e474ce620489394a34400ff8c74e942745fa5e Mon Sep 17 00:00:00 2001 From: Rubocop Challenger Date: Fri, 9 Feb 2024 23:31:59 +0000 Subject: [PATCH 3/3] :police_car: regenerate rubocop todo --- .rubocop_todo.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e62203bd..9f237da5 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config --exclude-limit 180` -# on 2024-02-09 23:31:40 UTC using RuboCop version 1.60.2. +# on 2024-02-09 23:31:57 UTC using RuboCop version 1.60.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 @@ -313,7 +313,6 @@ Layout/ExtraSpacing: - 'spec/lib/apipie/generator/swagger/param_description/type_spec.rb' - 'spec/lib/swagger/swagger_dsl_spec.rb' - # Offense count: 38 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, IndentationWidth.