Skip to content

Commit ba9d5c9

Browse files
committed
Cosmetic generator fixes
1 parent ba16b66 commit ba9d5c9

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

gems/smithy/lib/smithy/templates/client/endpoint_provider_spec.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ module <%= module_name %>
2727
expect(endpoint.properties).to eq(expected['endpoint']['properties'] || {})
2828
<% end -%>
2929
end
30-
3130
<% test_case.operation_inputs.each do |operation_input| -%>
31+
3232
it 'produces the correct output from the client when calling <%= operation_input.operation_name %>' do
3333
client = Client.new(
3434
stub_responses: true,

gems/smithy/lib/smithy/templates/client/waiters.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
# This is generated code!
44

55
module <%= module_name %>
6-
76
# @api private
87
module Waiters
8+
99
<% waiters.each do |waiter| -%>
1010
<% if waiter.deprecated? -%>
1111
# @deprecated

gems/smithy/lib/smithy/views/client/auth_resolver.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def auth_rules_code
3535

3636
def add_service_auth_schemes_to_code(lines)
3737
service_auth_schemes.each do |auth_scheme|
38-
lines << "options << Smithy::Client::AuthOption.new(scheme_id: '#{auth_scheme}')"
38+
lines << " options << Smithy::Client::AuthOption.new(scheme_id: '#{auth_scheme}')"
3939
end
4040
end
4141

gems/smithy/lib/smithy/views/client/endpoint_parameter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def default_value
5555
end
5656

5757
def validate_required?
58-
@data['required'] && !@data['default']
58+
@data['required'] && !@data.key?('default')
5959
end
6060

6161
def create_from_config?

gems/smithy/lib/smithy/views/client/endpoint_parameters.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ def initialize(plan)
1111
service = @plan.service
1212
@endpoint_rules = service.values.first['traits']['smithy.rules#endpointRuleSet']
1313
@operations = Model::ServiceIndex.new(@model).operations_for(@plan.service)
14-
@parameters = @endpoint_rules['parameters']
15-
.map { |id, data| EndpointParameter.new(id, data, @plan) }
14+
@parameters = @endpoint_rules['parameters'].map { |id, data| EndpointParameter.new(id, data, @plan) }
1615
@operation_params = build_operation_params
1716

1817
super()

gems/smithy/lib/smithy/views/client/schema.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,9 @@ def initialize(service, id, shape)
168168
attr_reader :type, :id, :name
169169

170170
def initializer
171-
traits_str = ", traits: #{@traits}" unless @traits.empty?
172-
"::Smithy::Schema::Shapes::#{SHAPE_CLASS_MAP[@type]}.new(id: '#{@id}', name: '#{@name}'#{traits_str})"
171+
options_str = "id: \"#{@id}\", name: \"#{@name}\""
172+
options_str += ", traits: #{@traits}" unless @traits.empty?
173+
"::Smithy::Schema::Shapes::#{SHAPE_CLASS_MAP[@type]}.new(#{options_str})"
173174
end
174175
end
175176

@@ -327,7 +328,7 @@ def initialize(service, location_name, shape_ref)
327328

328329
def initializer
329330
options_str = "shape: #{@shape}"
330-
options_str += ", location_name: '#{@location_name}'" if @location_name
331+
options_str += ", location_name: \"#{@location_name}\"" if @location_name
331332
options_str += ", traits: #{@traits}" unless @traits.empty?
332333
"::Smithy::Schema::Shapes::ShapeRef.new(#{options_str})"
333334
end

0 commit comments

Comments
 (0)