Skip to content

Commit 3db45d3

Browse files
committed
Lint: Fix layout offenses
No functional changes, only indentation and other whitespace issues, plus some other simple layout fixes.
1 parent afbf222 commit 3db45d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+313
-396
lines changed

.standard_todo.yml

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ ignore:
88
- lib/zendesk_api/actions.rb:
99
- Lint/AssignmentInCondition
1010
- Style/HashSyntax
11-
- Layout/SpaceInsideHashLiteralBraces
1211
- lib/zendesk_api/association.rb:
1312
- Style/HashSyntax
1413
- Lint/AssignmentInCondition
1514
- Lint/ShadowedArgument
16-
- Layout/SpaceInsideBlockBraces
1715
- Style/SafeNavigation
1816
- lib/zendesk_api/associations.rb:
1917
- Style/HashSyntax
@@ -22,9 +20,7 @@ ignore:
2220
- Performance/RedundantMerge
2321
- lib/zendesk_api/client.rb:
2422
- Style/MissingRespondToMissing
25-
- Layout/SpaceInsideHashLiteralBraces
2623
- Style/HashSyntax
27-
- Layout/ArgumentAlignment
2824
- Lint/AssignmentInCondition
2925
- lib/zendesk_api/collection.rb:
3026
- Style/PercentLiteralDelimiters
@@ -34,11 +30,8 @@ ignore:
3430
- Style/Alias
3531
- Performance/StringIdentifierArgument
3632
- Style/ParenthesesAroundCondition
37-
- Layout/SpaceInsideHashLiteralBraces
3833
- lib/zendesk_api/configuration.rb:
3934
- Style/HashSyntax
40-
- lib/zendesk_api/helpers.rb:
41-
- Layout/DotPosition
4235
- lib/zendesk_api/middleware/request/encode_json.rb:
4336
- Lint/Void
4437
- lib/zendesk_api/middleware/request/etag_cache.rb:
@@ -51,19 +44,15 @@ ignore:
5144
- Lint/RedundantStringCoercion
5245
- lib/zendesk_api/pagination.rb:
5346
- Style/Alias
54-
- Layout/SpaceInsideHashLiteralBraces
55-
- Layout/ClosingParenthesisIndentation
5647
- lib/zendesk_api/resource.rb:
5748
- Style/Alias
5849
- Style/TrivialAccessors
5950
- Style/HashSyntax
6051
- Lint/DuplicateMethods
6152
- Performance/Caller
62-
- Layout/SpaceInsideHashLiteralBraces
6353
- lib/zendesk_api/resources.rb:
6454
- Style/Alias
6555
- Style/HashSyntax
66-
- Layout/SpaceInsideHashLiteralBraces
6756
- Style/PercentLiteralDelimiters
6857
- Lint/AssignmentInCondition
6958
- lib/zendesk_api/search.rb:
@@ -72,215 +61,143 @@ ignore:
7261
- Style/Alias
7362
- spec/core/association_spec.rb:
7463
- Style/HashSyntax
75-
- Layout/SpaceInsideHashLiteralBraces
7664
- spec/core/bulk_actions_spec.rb:
7765
- Style/HashSyntax
78-
- Layout/SpaceInsideHashLiteralBraces
79-
- Layout/ArgumentAlignment
80-
- Layout/MultilineMethodCallBraceLayout
8166
- spec/core/client_spec.rb:
82-
- Layout/SpaceInsideHashLiteralBraces
8367
- Style/HashSyntax
8468
- spec/core/collection_spec.rb:
85-
- Layout/SpaceInsideHashLiteralBraces
8669
- Style/HashSyntax
87-
- Layout/ArgumentAlignment
88-
- Layout/MultilineMethodCallBraceLayout
89-
- Layout/ClosingParenthesisIndentation
9070
- Lint/ConstantDefinitionInBlock
9171
- Lint/InheritException
9272
- Style/Proc
93-
- Layout/DotPosition
9473
- Style/PercentLiteralDelimiters
9574
- Style/TernaryParentheses
9675
- spec/core/configuration_spec.rb:
97-
- Layout/SpaceInsideHashLiteralBraces
9876
- Style/HashSyntax
9977
- spec/core/create_resource_spec.rb:
100-
- Layout/SpaceInsideHashLiteralBraces
10178
- Style/HashSyntax
102-
- spec/core/data_namespace_spec.rb:
103-
- Layout/DotPosition
10479
- spec/core/data_resource_spec.rb:
10580
- Style/HashSyntax
106-
- Layout/SpaceInsideHashLiteralBraces
10781
- spec/core/middleware/request/encode_json_spec.rb:
108-
- Layout/SpaceInsideHashLiteralBraces
10982
- Style/HashSyntax
11083
- spec/core/middleware/request/etag_cache_spec.rb:
11184
- Style/HashSyntax
112-
- Layout/SpaceInsideHashLiteralBraces
11385
- Style/PercentLiteralDelimiters
11486
- spec/core/middleware/request/retry_spec.rb:
115-
- Layout/DotPosition
11687
- Style/HashSyntax
117-
- Layout/SpaceInsideHashLiteralBraces
11888
- spec/core/middleware/request/upload_spec.rb:
11989
- Style/HashSyntax
120-
- Layout/SpaceInsideHashLiteralBraces
12190
- spec/core/middleware/response/callback_spec.rb:
12291
- Style/HashSyntax
123-
- Layout/SpaceInsideHashLiteralBraces
12492
- spec/core/middleware/response/deflate_spec.rb:
12593
- Style/HashSyntax
12694
- spec/core/middleware/response/gzip_spec.rb:
12795
- Style/HashSyntax
128-
- spec/core/middleware/response/parse_iso_dates_spec.rb:
129-
- Layout/SpaceInsideHashLiteralBraces
13096
- spec/core/middleware/response/parse_json_spec.rb:
13197
- Style/HashSyntax
13298
- spec/core/middleware/response/raise_error_spec.rb:
13399
- Style/HashSyntax
134-
- Layout/ArgumentAlignment
135-
- Layout/SpaceInsideHashLiteralBraces
136100
- spec/core/read_resource_spec.rb:
137101
- Style/HashSyntax
138-
- Layout/SpaceBeforeBlockBraces
139-
- Layout/ArgumentAlignment
140-
- Layout/SpaceInsideHashLiteralBraces
141-
- Layout/ClosingParenthesisIndentation
142102
- spec/core/resource_spec.rb:
143-
- Layout/SpaceInsideHashLiteralBraces
144103
- Style/HashSyntax
145104
- Lint/ConstantDefinitionInBlock
146105
- Style/PercentLiteralDelimiters
147-
- Layout/SpaceBeforeBlockBraces
148106
- spec/core/resources/automation_spec.rb:
149107
- Style/HashSyntax
150-
- Layout/SpaceInsideHashLiteralBraces
151108
- spec/core/resources/macro_spec.rb:
152109
- Style/HashSyntax
153-
- Layout/SpaceInsideHashLiteralBraces
154110
- spec/core/resources/trigger_spec.rb:
155111
- Style/HashSyntax
156-
- Layout/SpaceInsideHashLiteralBraces
157112
- spec/core/resources/view_spec.rb:
158113
- Style/HashSyntax
159-
- Layout/SpaceInsideHashLiteralBraces
160114
- Style/PercentLiteralDelimiters
161-
- spec/core/search_spec.rb:
162-
- Layout/SpaceInsideHashLiteralBraces
163115
- spec/core/spec_helper.rb:
164116
- Style/GlobalVars
165117
- Style/HashSyntax
166-
- Layout/SpaceInsideHashLiteralBraces
167118
- Style/MixinUsage
168119
- spec/core/trackie_spec.rb:
169120
- Style/BlockComments
170121
- spec/fixtures/zendesk.rb:
171122
- Style/HashSyntax
172-
- Layout/SpaceInsideHashLiteralBraces
173123
- spec/live/app_installation_spec.rb:
174124
- Style/HashSyntax
175-
- Layout/SpaceInsideHashLiteralBraces
176125
- Style/PercentLiteralDelimiters
177126
- spec/live/app_spec.rb:
178127
- Style/HashSyntax
179-
- Layout/SpaceInsideHashLiteralBraces
180128
- Style/PercentLiteralDelimiters
181129
- spec/live/article_spec.rb:
182-
- Layout/SpaceInsideHashLiteralBraces
183130
- Style/HashSyntax
184131
- spec/live/automation_spec.rb:
185132
- Style/HashSyntax
186-
- Layout/SpaceInsideHashLiteralBraces
187133
- spec/live/bookmark_spec.rb:
188-
- Layout/SpaceInsideHashLiteralBraces
189134
- Style/HashSyntax
190135
- spec/live/brand_spec.rb:
191-
- Layout/SpaceInsideHashLiteralBraces
192136
- Style/HashSyntax
193137
- spec/live/category_spec.rb:
194-
- Layout/SpaceInsideHashLiteralBraces
195138
- Style/HashSyntax
196139
- spec/live/dynamic_content/item_spec.rb:
197140
- Style/HashSyntax
198141
- spec/live/dynamic_content/variant_spec.rb:
199142
- Style/HashSyntax
200143
- spec/live/group_membership_spec.rb:
201-
- Layout/SpaceInsideHashLiteralBraces
202144
- Style/HashSyntax
203145
- spec/live/group_spec.rb:
204-
- Layout/SpaceInsideHashLiteralBraces
205146
- Style/HashSyntax
206147
- spec/live/identity_spec.rb:
207-
- Layout/SpaceInsideHashLiteralBraces
208148
- Style/HashSyntax
209149
- spec/live/macro_spec.rb:
210-
- Layout/SpaceInsideHashLiteralBraces
211150
- Style/HashSyntax
212151
- Lint/RedundantStringCoercion
213152
- spec/live/organization_field_spec.rb:
214-
- Layout/SpaceInsideHashLiteralBraces
215153
- Style/HashSyntax
216154
- spec/live/organization_membership_spec.rb:
217-
- Layout/SpaceInsideHashLiteralBraces
218155
- Style/HashSyntax
219156
- spec/live/organization_spec.rb:
220-
- Layout/SpaceInsideHashLiteralBraces
221157
- Style/HashSyntax
222158
- spec/live/organization_subscription_spec.rb:
223-
- Layout/SpaceInsideHashLiteralBraces
224159
- Style/HashSyntax
225160
- spec/live/push_notification_device_spec.rb:
226161
- Style/PercentLiteralDelimiters
227162
- spec/live/request_spec.rb:
228163
- Style/HashSyntax
229-
- Layout/SpaceInsideHashLiteralBraces
230164
- spec/live/section_spec.rb:
231-
- Layout/SpaceInsideHashLiteralBraces
232165
- Style/HashSyntax
233166
- spec/live/setting_spec.rb:
234167
- Style/HashSyntax
235168
- spec/live/suspended_ticket_spec.rb:
236169
- Style/HashSyntax
237-
- Layout/SpaceInsideHashLiteralBraces
238170
- spec/live/tag_spec.rb:
239171
- Style/PercentLiteralDelimiters
240172
- Style/HashSyntax
241173
- spec/live/target_spec.rb:
242174
- Style/HashSyntax
243175
- Lint/BooleanSymbol
244176
- spec/live/ticket_field_spec.rb:
245-
- Layout/SpaceInsideHashLiteralBraces
246177
- Style/HashSyntax
247178
- spec/live/ticket_form_spec.rb:
248-
- Layout/SpaceInsideHashLiteralBraces
249179
- Style/HashSyntax
250180
- spec/live/ticket_spec.rb:
251181
- Style/HashSyntax
252-
- Layout/SpaceInsideHashLiteralBraces
253182
- Style/PercentLiteralDelimiters
254-
- Layout/FirstHashElementIndentation
255183
- spec/live/topic_spec.rb:
256184
- Style/HashSyntax
257185
- spec/live/trigger_category_spec.rb:
258-
- Layout/SpaceInsideHashLiteralBraces
259186
- Style/HashSyntax
260187
- spec/live/trigger_spec.rb:
261188
- Style/HashSyntax
262-
- Layout/SpaceInsideHashLiteralBraces
263189
- spec/live/upload_spec.rb:
264-
- Layout/SpaceInsideHashLiteralBraces
265190
- Style/HashSyntax
266191
- spec/live/user_field_spec.rb:
267-
- Layout/SpaceInsideHashLiteralBraces
268192
- Style/HashSyntax
269193
- spec/live/user_spec.rb:
270-
- Layout/SpaceInsideHashLiteralBraces
271194
- Style/HashSyntax
272195
- spec/live/user_view_spec.rb:
273196
- Style/HashSyntax
274-
- Layout/HashAlignment
275-
- Layout/SpaceInsideHashLiteralBraces
276197
- spec/live/view_spec.rb:
277198
- Style/HashSyntax
278-
- Layout/SpaceInsideHashLiteralBraces
279199
- spec/macros/resource_macros.rb:
280-
- Layout/SpaceInsideHashLiteralBraces
281200
- Lint/RedundantStringCoercion
282201
- Style/HashSyntax
283202
- Performance/RedundantMerge
284203
- Style/MultilineIfModifier
285-
- zendesk_api.gemspec:
286-
- Layout/ExtraSpacing

lib/zendesk_api/actions.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ module CreateMany
172172
# @return [JobStatus] the {JobStatus} instance for this create job
173173
def create_many!(client, attributes_array, association = Association.new(:class => self))
174174
response = client.connection.post("#{association.generate_path}/create_many") do |req|
175-
req.body = { resource_name => attributes_array }
175+
req.body = {resource_name => attributes_array}
176176

177177
yield req if block_given?
178178
end
@@ -187,7 +187,7 @@ module CreateOrUpdate
187187
# @param [Hash] attributes The attributes to create.
188188
def create_or_update!(client, attributes, association = Association.new(:class => self))
189189
response = client.connection.post("#{association.generate_path}/create_or_update") do |req|
190-
req.body = { singular_resource_name => attributes }
190+
req.body = {singular_resource_name => attributes}
191191

192192
yield req if block_given?
193193
end
@@ -207,7 +207,7 @@ def create_or_update_many!(client, attributes)
207207
association = Association.new(:class => self)
208208

209209
response = client.connection.post("#{association.generate_path}/create_or_update_many") do |req|
210-
req.body = { resource_name => attributes }
210+
req.body = {resource_name => attributes}
211211

212212
yield req if block_given?
213213
end
@@ -271,7 +271,7 @@ module DestroyMany
271271
# @return [JobStatus] the {JobStatus} instance for this destroy job
272272
def destroy_many!(client, ids, association = Association.new(:class => self))
273273
response = client.connection.delete("#{association.generate_path}/destroy_many") do |req|
274-
req.params = { :ids => ids.join(",") }
274+
req.params = {:ids => ids.join(",")}
275275

276276
yield req if block_given?
277277
end
@@ -319,10 +319,10 @@ def update_many!(client, ids_or_attributes, attributes = {})
319319

320320
response = client.connection.put("#{association.generate_path}/update_many") do |req|
321321
if attributes == {}
322-
req.body = { resource_name => ids_or_attributes }
322+
req.body = {resource_name => ids_or_attributes}
323323
else
324-
req.params = { :ids => ids_or_attributes.join(",") }
325-
req.body = { singular_resource_name => attributes }
324+
req.params = {:ids => ids_or_attributes.join(",")}
325+
req.body = {singular_resource_name => attributes}
326326
end
327327

328328
yield req if block_given?

lib/zendesk_api/association.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,15 +109,15 @@ def _side_load(resource, side_loads)
109109
def side_load_from_parent_id(resource, side_loads, key)
110110
key = "#{resource.class.singular_resource_name}_id"
111111

112-
resource.send("#{options.name}=", _side_load(resource, side_loads.select {|side_load|
112+
resource.send("#{options.name}=", _side_load(resource, side_loads.select { |side_load|
113113
side_load[key] == resource.id
114114
}))
115115
end
116116

117117
def side_load_from_child_ids(resource, side_loads, plural_key)
118118
ids = resource.send(plural_key)
119119

120-
resource.send("#{options.name}=", _side_load(resource, side_loads.select {|side_load|
120+
resource.send("#{options.name}=", _side_load(resource, side_loads.select { |side_load|
121121
ids.include?(side_load[options.include_key])
122122
}))
123123
end

lib/zendesk_api/client.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def method_missing(method, *args, &)
4444
return ZendeskAPI::Collection.new(self, resource_class, options)
4545
end
4646

47-
@resource_cache[method] ||= { :class => nil, :cache => ZendeskAPI::LRUCache.new }
47+
@resource_cache[method] ||= {:class => nil, :cache => ZendeskAPI::LRUCache.new}
4848
if !options.delete(:reload) && (cached = @resource_cache[method][:cache].read(options.hash))
4949
cached
5050
else
@@ -191,9 +191,9 @@ def build_connection
191191
# Should always be first in the stack
192192
if config.retry
193193
builder.use ZendeskAPI::Middleware::Request::Retry,
194-
:logger => config.logger,
195-
:retry_codes => config.retry_codes,
196-
:retry_on_exception => config.retry_on_exception
194+
:logger => config.logger,
195+
:retry_codes => config.retry_codes,
196+
:retry_on_exception => config.retry_on_exception
197197
end
198198
if config.raise_error_when_rate_limited
199199
builder.use ZendeskAPI::Middleware::Request::RaiseRateLimited, :logger => config.logger

lib/zendesk_api/collection.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ def join_special_params
378378
def set_association_from_options
379379
@collection_path = @options.delete(:collection_path)
380380

381-
association_options = { :path => @options.delete(:path) }
381+
association_options = {:path => @options.delete(:path)}
382382
association_options[:path] ||= @collection_path.join("/") if @collection_path
383383
@association = @options.delete(:association) || Association.new(association_options.merge(:class => @resource_class))
384384
@collection_path ||= [@resource]
@@ -443,7 +443,7 @@ def wrap_resource(res, with_association = with_association?)
443443
res = res.merge(:association => @association) if with_association
444444
@resource_class.new(@client, res)
445445
else
446-
res = { :id => res }
446+
res = {:id => res}
447447
res.merge!(:association => @association) if with_association
448448
@resource_class.new(@client, res)
449449
end

0 commit comments

Comments
 (0)