Skip to content

Commit

Permalink
Layout/FirstArrayElementIndentation-20240209233127 (#914)
Browse files Browse the repository at this point in the history
* 🚓 regenerate rubocop todo

* 🚓 Layout/FirstArrayElementIndentation

* 🚓 regenerate rubocop todo

---------

Co-authored-by: Rubocop Challenger <[email protected]>
Co-authored-by: Mathieu Jobin <[email protected]>
  • Loading branch information
3 people authored May 30, 2024
1 parent 3cf67bd commit 77b075e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 29 deletions.
9 changes: 0 additions & 9 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions spec/dummy/app/controllers/pets_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 77b075e

Please sign in to comment.