Skip to content

Commit b26d640

Browse files
committed
Layout/SpaceInsideArrayLiteralBrackets
This commit enables the Rubocop Layout/SpaceInsideArrayLiteralBrackets cop and addresses all offenses.
1 parent 4d45b79 commit b26d640

Some content is hidden

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

53 files changed

+89
-96
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ I18n/GetText/DecorateStringFormattingUsingPercent:
2222
I18n/RailsI18n/DecorateString:
2323
Enabled: false
2424

25-
# This cop supports safe auto-correction (--auto-correct).
26-
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets.
27-
# SupportedStyles: space, no_space, compact
28-
# SupportedStylesForEmptyBrackets: space, no_space
29-
Layout/SpaceInsideArrayLiteralBrackets:
30-
Enabled: false
31-
3225
# This cop supports safe auto-correction (--auto-correct).
3326
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
3427
# SupportedStyles: space, no_space

lib/puppet/application/device.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ def find_resources(type, name)
399399
key = [type, name].join('/')
400400

401401
if name
402-
[ Puppet::Resource.indirection.find( key ) ]
402+
[Puppet::Resource.indirection.find( key )]
403403
else
404404
Puppet::Resource.indirection.search( key, {} )
405405
end

lib/puppet/application/resource.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,13 @@ def find_or_save_resources(type, name, params)
231231
Puppet.override(stringify_rich: true) do
232232
if name
233233
if params.empty?
234-
[ Puppet::Resource.indirection.find( key ) ]
234+
[Puppet::Resource.indirection.find( key )]
235235
else
236236
resource = Puppet::Resource.new( type, name, :parameters => params )
237237

238238
# save returns [resource that was saved, transaction log from applying the resource]
239239
save_result = Puppet::Resource.indirection.save(resource, key)
240-
[ save_result.first ]
240+
[save_result.first]
241241
end
242242
else
243243
if type == "file"

lib/puppet/face/help.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def all_application_summaries()
175175
rescue StandardError, LoadError
176176
error_message = _("!%{sub_command}! Subcommand unavailable due to error.") % { sub_command: appname }
177177
error_message += ' ' + _("Check error logs.")
178-
result << [ error_message, '', ' ' ]
178+
result << [error_message, '', ' ']
179179
end
180180
else
181181
begin
@@ -187,7 +187,7 @@ def all_application_summaries()
187187
rescue StandardError, LoadError
188188
error_message = _("!%{sub_command}! Subcommand unavailable due to error.") % { sub_command: appname }
189189
error_message += ' ' + _("Check error logs.")
190-
result << [ error_message, '', ' ' ]
190+
result << [error_message, '', ' ']
191191
end
192192
end
193193
end

lib/puppet/face/parser.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484

8585
when_rendering :json do |errors|
8686
unless errors.empty?
87-
ignore_error_keys = [ :arguments, :environment, :node ]
87+
ignore_error_keys = [:arguments, :environment, :node]
8888

8989
data = errors.map do |file, error|
9090
file_errors = error.to_h.reject { |k, _| ignore_error_keys.include?(k) }

lib/puppet/ffi/windows/functions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ module Functions
235235
# );
236236
ffi_lib :advapi32
237237
attach_function_private :GetTokenInformation,
238-
[:handle, TOKEN_INFORMATION_CLASS, :lpvoid, :dword, :pdword ], :win32_bool
238+
[:handle, TOKEN_INFORMATION_CLASS, :lpvoid, :dword, :pdword], :win32_bool
239239

240240
# https://msdn.microsoft.com/en-us/library/windows/desktop/ms724451(v=vs.85).aspx
241241
# BOOL WINAPI GetVersionEx(

lib/puppet/file_serving/http_metadata.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def initialize(http_response, path = '/dev/null')
5050
def collect
5151
# Prefer the checksum_type from the indirector request options
5252
# but fall back to the alternative otherwise
53-
[ @checksum_type, :sha256, :sha1, :md5, :mtime ].each do |type|
53+
[@checksum_type, :sha256, :sha1, :md5, :mtime].each do |type|
5454
@checksum_type = type
5555
@checksum = @checksums[type]
5656
break if @checksum

lib/puppet/file_system/uniquefile.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def try_convert_to_hash(h)
153153

154154
def tmpdir
155155
tmp = '.'
156-
for dir in [ ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], @@systmpdir, '/tmp']
156+
for dir in [ENV['TMPDIR'], ENV['TMP'], ENV['TEMP'], @@systmpdir, '/tmp']
157157
stat = File.stat(dir) if dir
158158
if stat && stat.directory? && stat.writable?
159159
tmp = dir

lib/puppet/indirector/file_bucket_file/file.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def list(request)
6969
filestat = Time.parse(item.stat.mtime.to_s)
7070
if from <= filestat and filestat <= to
7171
filenames.each do |filename|
72-
bucket[filename] += [[ item.stat.mtime, item.parent.basename ]]
72+
bucket[filename] += [[item.stat.mtime, item.parent.basename]]
7373
end
7474
end
7575
end

lib/puppet/indirector/rest.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def convert_to_http_error(response)
5050
# body, decompressed if necessary
5151
def parse_response(response)
5252
if response['content-type']
53-
[ response['content-type'].gsub(/\s*;.*$/, ''), response.body ]
53+
[response['content-type'].gsub(/\s*;.*$/, ''), response.body]
5454
else
5555
raise _("No content type in http response; cannot parse")
5656
end

0 commit comments

Comments
 (0)