Skip to content

Commit 931aee0

Browse files
(PUP-11767) Fix Style/ClassCheck from rubocop_todo
1 parent 70a53be commit 931aee0

File tree

14 files changed

+16
-35
lines changed

14 files changed

+16
-35
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -361,25 +361,6 @@ Style/CaseLikeIf:
361361
Style/ClassAndModuleChildren:
362362
Enabled: false
363363

364-
# This cop supports safe auto-correction (--auto-correct).
365-
# Configuration parameters: EnforcedStyle.
366-
# SupportedStyles: is_a?, kind_of?
367-
Style/ClassCheck:
368-
Exclude:
369-
- 'lib/puppet/error.rb'
370-
- 'lib/puppet/functions.rb'
371-
- 'lib/puppet/graph/simple_graph.rb'
372-
- 'lib/puppet/node/environment.rb'
373-
- 'lib/puppet/provider/group/groupadd.rb'
374-
- 'lib/puppet/provider/group/windows_adsi.rb'
375-
- 'lib/puppet/provider/user/windows_adsi.rb'
376-
- 'lib/puppet/settings.rb'
377-
- 'lib/puppet/settings/environment_conf.rb'
378-
- 'lib/puppet/type.rb'
379-
- 'lib/puppet/util/suidmanager.rb'
380-
- 'lib/puppet/util/windows/adsi.rb'
381-
- 'lib/puppet/util/windows/sid.rb'
382-
383364
# This cop supports safe auto-correction (--auto-correct).
384365
# Configuration parameters: IgnoredMethods.
385366
# IgnoredMethods: ==, equal?, eql?

lib/puppet/error.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module ExternalFileError
2121
# 4 args including the position on the line.
2222
#
2323
def initialize(message, file = nil, line = nil, pos = nil, original = nil)
24-
if pos.kind_of? Exception
24+
if pos.is_a? Exception
2525
original = pos
2626
pos = nil
2727
end

lib/puppet/functions.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ def type(assignment_string)
642642
ruby_file_location: rb_location
643643
}
644644
end
645-
unless result.body.kind_of?(Puppet::Pops::Model::TypeAlias)
645+
unless result.body.is_a?(Puppet::Pops::Model::TypeAlias)
646646
rb_location = rb_location.gsub(/:in.*$/, '')
647647
raise ArgumentError, _("Expected a type alias assignment on the form 'AliasType = T', got '%{assignment_string}'.\n" +
648648
"Called from <%{ruby_file_location}>") % {

lib/puppet/graph/simple_graph.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,15 +458,15 @@ def to_dot_graph(params = {})
458458
'fontsize' => fontsize,
459459
'label' => name }
460460
v_label = v.ref
461-
params.merge!(v_label) if v_label and v_label.kind_of? Hash
461+
params.merge!(v_label) if v_label and v_label.is_a? Hash
462462
graph << DOT::DOTNode.new(params)
463463
end
464464
edges.each do |e|
465465
params = { 'from' => stringify(e.source.ref),
466466
'to' => stringify(e.target.ref),
467467
'fontsize' => fontsize }
468468
e_label = e.ref
469-
params.merge!(e_label) if e_label and e_label.kind_of? Hash
469+
params.merge!(e_label) if e_label and e_label.is_a? Hash
470470
graph << edge_klass.new(params)
471471
end
472472
graph

lib/puppet/node/environment.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ def self.split_path(path_string)
539539
end
540540

541541
def ==(other)
542-
return true if other.kind_of?(Puppet::Node::Environment) &&
542+
return true if other.is_a?(Puppet::Node::Environment) &&
543543
self.name == other.name &&
544544
self.full_modulepath == other.full_modulepath &&
545545
self.manifest == other.manifest

lib/puppet/provider/group/groupadd.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def members_insync?(current, should)
127127
end
128128

129129
def members_to_s(current)
130-
return '' if current.nil? || !current.kind_of?(Array)
130+
return '' if current.nil? || !current.is_a?(Array)
131131

132132
current.join(',')
133133
end

lib/puppet/provider/group/windows_adsi.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def members_insync?(current, should)
4040
end
4141

4242
def members_to_s(users)
43-
return '' if users.nil? or !users.kind_of?(Array)
43+
return '' if users.nil? or !users.is_a?(Array)
4444

4545
users = users.map do |user_name|
4646
sid = Puppet::Util::Windows::SID.name_to_principal(user_name)

lib/puppet/provider/user/windows_adsi.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def groups_insync?(current, should)
6969
end
7070

7171
def groups_to_s(groups)
72-
return '' if groups.nil? || !groups.kind_of?(Array)
72+
return '' if groups.nil? || !groups.is_a?(Array)
7373

7474
groups = groups.map do |group_name|
7575
sid = Puppet::Util::Windows::SID.name_to_principal(group_name)

lib/puppet/settings.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def optparse_addargs(options)
241241
# Is our setting a boolean setting?
242242
def boolean?(param)
243243
param = param.to_sym
244-
@config.include?(param) and @config[param].kind_of?(BooleanSetting)
244+
@config.include?(param) and @config[param].is_a?(BooleanSetting)
245245
end
246246

247247
# Remove all set values, potentially skipping cli values.

lib/puppet/settings/environment_conf.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def environment_data_provider
100100
def modulepath
101101
default_modulepath = [File.join(@path_to_env, "modules")] + @global_module_path
102102
get_setting(:modulepath, default_modulepath) do |modulepath|
103-
path = modulepath.kind_of?(String) ?
103+
path = modulepath.is_a?(String) ?
104104
modulepath.split(File::PATH_SEPARATOR) :
105105
modulepath
106106
path.map { |p| expand_glob(absolute(p)) }.flatten.join(File::PATH_SEPARATOR)

0 commit comments

Comments
 (0)