diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index d9167e65..11eef51c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -313,15 +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). # Configuration parameters: EnforcedStyle, IndentationWidth. diff --git a/spec/dummy/app/controllers/pets_controller.rb b/spec/dummy/app/controllers/pets_controller.rb index fbf5516c..4267d02f 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