From d7fa73df08bf56b00f495fb7338012c1266867cd Mon Sep 17 00:00:00 2001 From: markuszilch Date: Tue, 20 Feb 2024 15:34:48 +0100 Subject: [PATCH] fix slicingwithrange cop --- .rubocop_todo.yml | 10 ---------- lib/puppet/type/cs_clone.rb | 2 +- lib/puppet/type/cs_colocation.rb | 2 +- lib/puppet/type/cs_group.rb | 2 +- lib/puppet/type/cs_location.rb | 2 +- lib/puppet/type/cs_order.rb | 2 +- 6 files changed, 5 insertions(+), 15 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 94105234..9a195e25 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -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' diff --git a/lib/puppet/type/cs_clone.rb b/lib/puppet/type/cs_clone.rb index 5b89c58d..5cc551e4 100644 --- a/lib/puppet/type/cs_clone.rb +++ b/lib/puppet/type/cs_clone.rb @@ -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 diff --git a/lib/puppet/type/cs_colocation.rb b/lib/puppet/type/cs_colocation.rb index 2b6fca37..54467600 100644 --- a/lib/puppet/type/cs_colocation.rb +++ b/lib/puppet/type/cs_colocation.rb @@ -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 diff --git a/lib/puppet/type/cs_group.rb b/lib/puppet/type/cs_group.rb index 435ca576..a0b86d72 100644 --- a/lib/puppet/type/cs_group.rb +++ b/lib/puppet/type/cs_group.rb @@ -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 diff --git a/lib/puppet/type/cs_location.rb b/lib/puppet/type/cs_location.rb index f7a193e0..c9b42aeb 100644 --- a/lib/puppet/type/cs_location.rb +++ b/lib/puppet/type/cs_location.rb @@ -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 diff --git a/lib/puppet/type/cs_order.rb b/lib/puppet/type/cs_order.rb index be69dc09..60655d74 100644 --- a/lib/puppet/type/cs_order.rb +++ b/lib/puppet/type/cs_order.rb @@ -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