Skip to content

Commit 60e1ce5

Browse files
committed
Lint: Fix layout offenses
No functional changes, only indentation and other whitespace issues, plus some other simple layout fixes.
1 parent 615be85 commit 60e1ce5

Some content is hidden

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

64 files changed

+311
-396
lines changed

.standard_todo.yml

Lines changed: 0 additions & 84 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,216 +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/SpaceBeforeBlockBraces
130-
- Layout/SpaceInsideHashLiteralBraces
13196
- spec/core/middleware/response/parse_json_spec.rb:
13297
- Style/HashSyntax
13398
- spec/core/middleware/response/raise_error_spec.rb:
13499
- Style/HashSyntax
135-
- Layout/ArgumentAlignment
136-
- Layout/SpaceInsideHashLiteralBraces
137100
- spec/core/read_resource_spec.rb:
138101
- Style/HashSyntax
139-
- Layout/SpaceBeforeBlockBraces
140-
- Layout/ArgumentAlignment
141-
- Layout/SpaceInsideHashLiteralBraces
142-
- Layout/ClosingParenthesisIndentation
143102
- spec/core/resource_spec.rb:
144-
- Layout/SpaceInsideHashLiteralBraces
145103
- Style/HashSyntax
146104
- Lint/ConstantDefinitionInBlock
147105
- Style/PercentLiteralDelimiters
148-
- Layout/SpaceBeforeBlockBraces
149106
- spec/core/resources/automation_spec.rb:
150107
- Style/HashSyntax
151-
- Layout/SpaceInsideHashLiteralBraces
152108
- spec/core/resources/macro_spec.rb:
153109
- Style/HashSyntax
154-
- Layout/SpaceInsideHashLiteralBraces
155110
- spec/core/resources/trigger_spec.rb:
156111
- Style/HashSyntax
157-
- Layout/SpaceInsideHashLiteralBraces
158112
- spec/core/resources/view_spec.rb:
159113
- Style/HashSyntax
160-
- Layout/SpaceInsideHashLiteralBraces
161114
- Style/PercentLiteralDelimiters
162-
- spec/core/search_spec.rb:
163-
- Layout/SpaceInsideHashLiteralBraces
164115
- spec/core/spec_helper.rb:
165116
- Style/GlobalVars
166117
- Style/HashSyntax
167-
- Layout/SpaceInsideHashLiteralBraces
168118
- Style/MixinUsage
169119
- spec/core/trackie_spec.rb:
170120
- Style/BlockComments
171121
- spec/fixtures/zendesk.rb:
172122
- Style/HashSyntax
173-
- Layout/SpaceInsideHashLiteralBraces
174123
- spec/live/app_installation_spec.rb:
175124
- Style/HashSyntax
176-
- Layout/SpaceInsideHashLiteralBraces
177125
- Style/PercentLiteralDelimiters
178126
- spec/live/app_spec.rb:
179127
- Style/HashSyntax
180-
- Layout/SpaceInsideHashLiteralBraces
181128
- Style/PercentLiteralDelimiters
182129
- spec/live/article_spec.rb:
183-
- Layout/SpaceInsideHashLiteralBraces
184130
- Style/HashSyntax
185131
- spec/live/automation_spec.rb:
186132
- Style/HashSyntax
187-
- Layout/SpaceInsideHashLiteralBraces
188133
- spec/live/bookmark_spec.rb:
189-
- Layout/SpaceInsideHashLiteralBraces
190134
- Style/HashSyntax
191135
- spec/live/brand_spec.rb:
192-
- Layout/SpaceInsideHashLiteralBraces
193136
- Style/HashSyntax
194137
- spec/live/category_spec.rb:
195-
- Layout/SpaceInsideHashLiteralBraces
196138
- Style/HashSyntax
197139
- spec/live/dynamic_content/item_spec.rb:
198140
- Style/HashSyntax
199141
- spec/live/dynamic_content/variant_spec.rb:
200142
- Style/HashSyntax
201143
- spec/live/group_membership_spec.rb:
202-
- Layout/SpaceInsideHashLiteralBraces
203144
- Style/HashSyntax
204145
- spec/live/group_spec.rb:
205-
- Layout/SpaceInsideHashLiteralBraces
206146
- Style/HashSyntax
207147
- spec/live/identity_spec.rb:
208-
- Layout/SpaceInsideHashLiteralBraces
209148
- Style/HashSyntax
210149
- spec/live/macro_spec.rb:
211-
- Layout/SpaceInsideHashLiteralBraces
212150
- Style/HashSyntax
213151
- Lint/RedundantStringCoercion
214152
- spec/live/organization_field_spec.rb:
215-
- Layout/SpaceInsideHashLiteralBraces
216153
- Style/HashSyntax
217154
- spec/live/organization_membership_spec.rb:
218-
- Layout/SpaceInsideHashLiteralBraces
219155
- Style/HashSyntax
220156
- spec/live/organization_spec.rb:
221-
- Layout/SpaceInsideHashLiteralBraces
222157
- Style/HashSyntax
223158
- spec/live/organization_subscription_spec.rb:
224-
- Layout/SpaceInsideHashLiteralBraces
225159
- Style/HashSyntax
226160
- spec/live/push_notification_device_spec.rb:
227161
- Style/PercentLiteralDelimiters
228162
- spec/live/request_spec.rb:
229163
- Style/HashSyntax
230-
- Layout/SpaceInsideHashLiteralBraces
231164
- spec/live/section_spec.rb:
232-
- Layout/SpaceInsideHashLiteralBraces
233165
- Style/HashSyntax
234166
- spec/live/setting_spec.rb:
235167
- Style/HashSyntax
236168
- spec/live/suspended_ticket_spec.rb:
237169
- Style/HashSyntax
238-
- Layout/SpaceInsideHashLiteralBraces
239170
- spec/live/tag_spec.rb:
240171
- Style/PercentLiteralDelimiters
241172
- Style/HashSyntax
242173
- spec/live/target_spec.rb:
243174
- Style/HashSyntax
244175
- Lint/BooleanSymbol
245176
- spec/live/ticket_field_spec.rb:
246-
- Layout/SpaceInsideHashLiteralBraces
247177
- Style/HashSyntax
248178
- spec/live/ticket_form_spec.rb:
249-
- Layout/SpaceInsideHashLiteralBraces
250179
- Style/HashSyntax
251180
- spec/live/ticket_spec.rb:
252181
- Style/HashSyntax
253-
- Layout/SpaceInsideHashLiteralBraces
254182
- Style/PercentLiteralDelimiters
255-
- Layout/FirstHashElementIndentation
256183
- spec/live/topic_spec.rb:
257184
- Style/HashSyntax
258185
- spec/live/trigger_category_spec.rb:
259-
- Layout/SpaceInsideHashLiteralBraces
260186
- Style/HashSyntax
261187
- spec/live/trigger_spec.rb:
262188
- Style/HashSyntax
263-
- Layout/SpaceInsideHashLiteralBraces
264189
- spec/live/upload_spec.rb:
265-
- Layout/SpaceInsideHashLiteralBraces
266190
- Style/HashSyntax
267191
- spec/live/user_field_spec.rb:
268-
- Layout/SpaceInsideHashLiteralBraces
269192
- Style/HashSyntax
270193
- spec/live/user_spec.rb:
271-
- Layout/SpaceInsideHashLiteralBraces
272194
- Style/HashSyntax
273195
- spec/live/user_view_spec.rb:
274196
- Style/HashSyntax
275-
- Layout/HashAlignment
276-
- Layout/SpaceInsideHashLiteralBraces
277197
- spec/live/view_spec.rb:
278198
- Style/HashSyntax
279-
- Layout/SpaceInsideHashLiteralBraces
280199
- spec/macros/resource_macros.rb:
281-
- Layout/SpaceInsideHashLiteralBraces
282200
- Lint/RedundantStringCoercion
283201
- Style/HashSyntax
284202
- Performance/RedundantMerge
285203
- Style/MultilineIfModifier
286-
- zendesk_api.gemspec:
287-
- 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
@@ -43,7 +43,7 @@ def method_missing(method, *args, &)
4343
return ZendeskAPI::Collection.new(self, resource_class, options)
4444
end
4545

46-
@resource_cache[method] ||= { :class => nil, :cache => ZendeskAPI::LRUCache.new }
46+
@resource_cache[method] ||= {:class => nil, :cache => ZendeskAPI::LRUCache.new}
4747
if !options.delete(:reload) && (cached = @resource_cache[method][:cache].read(options.hash))
4848
cached
4949
else
@@ -171,9 +171,9 @@ def build_connection
171171
# Should always be first in the stack
172172
if config.retry
173173
builder.use ZendeskAPI::Middleware::Request::Retry,
174-
:logger => config.logger,
175-
:retry_codes => config.retry_codes,
176-
:retry_on_exception => config.retry_on_exception
174+
:logger => config.logger,
175+
:retry_codes => config.retry_codes,
176+
:retry_on_exception => config.retry_on_exception
177177
end
178178
if config.raise_error_when_rate_limited
179179
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)