Skip to content

Commit

Permalink
fix safenavigation cop
Browse files Browse the repository at this point in the history
  • Loading branch information
zilchms committed Feb 20, 2024
1 parent 8aea42c commit 083e280
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 9 deletions.
8 changes: 0 additions & 8 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,6 @@ Style/ClassEqualityComparison:
- 'lib/puppet/provider/cs_primitive/crm.rb'
- 'lib/puppet/provider/cs_primitive/pcs.rb'

# Offense count: 1
# This cop supports unsafe autocorrection (--autocorrect-all).
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
# AllowedMethods: present?, blank?, presence, try, try!
Style/SafeNavigation:
Exclude:
- 'lib/puppet/provider/cs_primitive/pcs.rb'

# Offense count: 5
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/SlicingWithRange:
Expand Down
2 changes: 1 addition & 1 deletion lib/puppet/provider/cs_primitive/pcs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def flush
if @resource && @resource.class.name == :cs_primitive && @resource[:unmanaged_metadata]
@resource[:unmanaged_metadata].each do |parameter_name|
@property_hash[:metadata].delete(parameter_name)
@property_hash[:existing_metadata].delete(parameter_name) if @property_hash[:existing_metadata]
@property_hash[:existing_metadata]&.delete(parameter_name)
end
end

Expand Down

0 comments on commit 083e280

Please sign in to comment.