Skip to content

Commit

Permalink
fix slicingwithrange cop
Browse files Browse the repository at this point in the history
  • Loading branch information
zilchms committed Feb 20, 2024
1 parent 083e280 commit d7fa73d
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 15 deletions.
10 changes: 0 additions & 10 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,3 @@ Style/ClassEqualityComparison:
Exclude:
- 'lib/puppet/provider/cs_primitive/crm.rb'
- 'lib/puppet/provider/cs_primitive/pcs.rb'

# Offense count: 5
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/SlicingWithRange:
Exclude:
- 'lib/puppet/type/cs_clone.rb'
- 'lib/puppet/type/cs_colocation.rb'
- 'lib/puppet/type/cs_group.rb'
- 'lib/puppet/type/cs_location.rb'
- 'lib/puppet/type/cs_order.rb'
2 changes: 1 addition & 1 deletion lib/puppet/type/cs_clone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@

def unmunge_cs_primitive(name)
name = name.split(':')[0]
name = name[3..-1] if name.start_with? 'ms_'
name = name[3..] if name.start_with? 'ms_'

name
end
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/cs_colocation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def extract_primitives

def unmunge_cs_primitive(name)
name = name.split(':')[0]
name = name[3..-1] if name.start_with? 'ms_'
name = name[3..] if name.start_with? 'ms_'

name
end
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/cs_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def insync?(is)

def unmunge_cs_primitive(name)
name = name.split(':')[0]
name = name[3..-1] if name.start_with? 'ms_'
name = name[3..] if name.start_with? 'ms_'

name
end
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/cs_location.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def insync?(is)

def unmunge_cs_primitive(name)
name = name.split(':')[0]
name = name[3..-1] if name.start_with? 'ms_'
name = name[3..] if name.start_with? 'ms_'

name
end
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/type/cs_order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def unmunge_cs_resourcename(name)
return if name.nil?

name = name.split(':')[0]
name = name[3..-1] if name.start_with? 'ms_'
name = name[3..] if name.start_with? 'ms_'

name
end
Expand Down

0 comments on commit d7fa73d

Please sign in to comment.