Skip to content

Commit 93dfd4c

Browse files
(PUP-11767) Enable Style/ColonMethodCall|CombineableLoops
1 parent d999d97 commit 93dfd4c

Some content is hidden

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

76 files changed

+142
-136
lines changed

.rubocop.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,3 +220,9 @@ Style/ClassMethods:
220220

221221
Style/CollectionCompact:
222222
Enabled: true
223+
224+
Style/ColonMethodCall:
225+
Enabled: true
226+
227+
Style/CombinableLoops:
228+
Enabled: true

lib/puppet/daemon.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def self.close_streams()
6868
Puppet.debug("Finished closing streams for daemon mode")
6969
rescue => detail
7070
Puppet.err "Could not start #{Puppet.run_mode.name}: #{detail}"
71-
Puppet::Util::replace_file("/tmp/daemonout", 0644) do |f|
71+
Puppet::Util.replace_file("/tmp/daemonout", 0644) do |f|
7272
f.puts "Could not start #{Puppet.run_mode.name}: #{detail}"
7373
end
7474
exit(12)

lib/puppet/face/generate.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
raise ArgumentError, _("The output directory '%{outputdir}' exists and is not a directory") % { outputdir: outputdir }
5959
end
6060

61-
Puppet::FileSystem::mkpath(outputdir)
61+
Puppet::FileSystem.mkpath(outputdir)
6262

6363
generator.generate(inputs, outputdir, options[:force])
6464

lib/puppet/file_bucket/file.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def checksum_data(base_method)
125125
end
126126

127127
def to_binary
128-
Puppet::FileSystem::binread(@path)
128+
Puppet::FileSystem.binread(@path)
129129
end
130130
end
131131
end

lib/puppet/file_system/windows.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def chmod(mode, path)
115115

116116
def read_preserve_line_endings(path)
117117
contents = path.read(:mode => 'rb', :encoding => 'bom|utf-8')
118-
contents = path.read(:mode => 'rb', :encoding => "bom|#{Encoding::default_external.name}") unless contents.valid_encoding?
118+
contents = path.read(:mode => 'rb', :encoding => "bom|#{Encoding.default_external.name}") unless contents.valid_encoding?
119119
contents = path.read unless contents.valid_encoding?
120120

121121
contents

lib/puppet/generate/type.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def format=(format)
4949
# @return [Boolean] Returns true if the output is up-to-date or false if not.
5050
def up_to_date?(outputdir)
5151
f = effective_output_path(outputdir)
52-
Puppet::FileSystem::exist?(f) && (Puppet::FileSystem::stat(@path) <=> Puppet::FileSystem::stat(f)) <= 0
52+
Puppet::FileSystem.exist?(f) && (Puppet::FileSystem.stat(@path) <=> Puppet::FileSystem.stat(f)) <= 0
5353
end
5454

5555
# Gets the filename of the output file.

lib/puppet/pal/compiler.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ def initialize(internal_compiler)
2525
#
2626
def call_function(function_name, *args, &block)
2727
# TRANSLATORS: do not translate variable name strings in these assertions
28-
Pal::assert_non_empty_string(function_name, 'function_name', false)
29-
Pal::assert_type(Pal::T_ANY_ARRAY, args, 'args', false)
28+
Pal.assert_non_empty_string(function_name, 'function_name', false)
29+
Pal.assert_type(Pal::T_ANY_ARRAY, args, 'args', false)
3030
internal_evaluator.evaluator.external_call_function(function_name, args, topscope, &block)
3131
end
3232

lib/puppet/parser/functions/assert_type.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
Puppet::Parser::Functions::newfunction(
3+
Puppet::Parser::Functions.newfunction(
44
:assert_type,
55
:type => :rvalue,
66
:arity => -3,

lib/puppet/parser/functions/binary_file.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
Puppet::Parser::Functions::newfunction(
3+
Puppet::Parser::Functions.newfunction(
44
:binary_file,
55
:type => :rvalue,
66
:arity => 1,

lib/puppet/parser/functions/break.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
Puppet::Parser::Functions::newfunction(
3+
Puppet::Parser::Functions.newfunction(
44
:break,
55
:arity => 0,
66
:doc => <<~DOC

0 commit comments

Comments
 (0)