Skip to content

Commit 37eae87

Browse files
(PUP-11767) Fix Style/For violations and remove from rubocop_todo
1 parent d1187e5 commit 37eae87

File tree

4 files changed

+5
-14
lines changed

4 files changed

+5
-14
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -463,15 +463,6 @@ Style/Encoding:
463463
Style/ExplicitBlockArgument:
464464
Enabled: false
465465

466-
# This cop supports safe auto-correction (--auto-correct).
467-
# Configuration parameters: EnforcedStyle.
468-
# SupportedStyles: each, for
469-
Style/For:
470-
Exclude:
471-
- 'lib/puppet/file_system/uniquefile.rb'
472-
- 'lib/puppet/module_tool/contents_description.rb'
473-
- 'lib/puppet/util/rdoc/generators/puppet_generator.rb'
474-
475466
# This cop supports safe auto-correction (--auto-correct).
476467
# Configuration parameters: EnforcedStyle.
477468
# SupportedStyles: format, sprintf, percent

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.fetch('TMPDIR', nil), ENV.fetch('TMP', nil), ENV.fetch('TEMP', nil), @@systmpdir, '/tmp']
156+
[ENV.fetch('TMPDIR', nil), ENV.fetch('TMP', nil), ENV.fetch('TEMP', nil), @@systmpdir, '/tmp'].each do |dir|
157157
stat = File.stat(dir) if dir
158158
if stat && stat.directory? && stat.writable?
159159
tmp = dir

lib/puppet/module_tool/contents_description.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ def data
3232
unless @data
3333
@data = []
3434
type_names = []
35-
for module_filename in Dir[File.join(@module_path, "lib/puppet/type/*.rb")]
35+
(Dir[File.join(@module_path, "lib/puppet/type/*.rb")]).each do |module_filename|
3636
require module_filename
3737
type_name = File.basename(module_filename, ".rb")
3838
type_names << type_name
3939

40-
for provider_filename in Dir[File.join(@module_path, "lib/puppet/provider/#{type_name}/*.rb")]
40+
(Dir[File.join(@module_path, "lib/puppet/provider/#{type_name}/*.rb")]).each do |provider_filename|
4141
require provider_filename
4242
end
4343
end

lib/puppet/util/rdoc/generators/puppet_generator.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ def main_url
323323
end
324324

325325
unless ref
326-
for file in @files
326+
@files.each do |file|
327327
if file.document_self and file.context.global
328328
ref = CGI.escapeHTML("#{CLASS_DIR}/#{file.context.module_name}.html")
329329
break
@@ -332,7 +332,7 @@ def main_url
332332
end
333333

334334
unless ref
335-
for file in @files
335+
@files.each do |file|
336336
if file.document_self and !file.context.global
337337
ref = CGI.escapeHTML("#{CLASS_DIR}/#{file.context.module_name}.html")
338338
break

0 commit comments

Comments
 (0)