Skip to content

Commit 476d0db

Browse files
committed
Correct Layout/EmptyLineAfterGuardClause
1 parent 9065bfb commit 476d0db

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

.rubocop_todo.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,11 @@
11
# This configuration was generated by
22
# `rubocop --auto-gen-config`
3-
# on 2024-05-28 10:29:32 UTC using RuboCop version 1.50.2.
3+
# on 2024-05-28 13:36:04 UTC using RuboCop version 1.50.2.
44
# The point is for the user to remove these configuration records
55
# one by one as the offenses are removed from the code base.
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 2
10-
# This cop supports safe autocorrection (--autocorrect).
11-
Layout/EmptyLineAfterGuardClause:
12-
Exclude:
13-
- 'lib/puppet/provider/base_dsc_lite/powershell.rb'
14-
- 'lib/puppet/type/dsc.rb'
15-
169
# Offense count: 27
1710
# This cop supports safe autocorrection (--autocorrect).
1811
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
@@ -78,17 +71,17 @@ Metrics/BlockLength:
7871
# Offense count: 1
7972
# Configuration parameters: CountComments, CountAsOne.
8073
Metrics/ClassLength:
81-
Max: 133
74+
Max: 111
8275

8376
# Offense count: 4
8477
# Configuration parameters: AllowedMethods, AllowedPatterns.
8578
Metrics/CyclomaticComplexity:
8679
Max: 31
8780

88-
# Offense count: 11
81+
# Offense count: 10
8982
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
9083
Metrics/MethodLength:
91-
Max: 54
84+
Max: 40
9285

9386
# Offense count: 4
9487
# Configuration parameters: AllowedMethods, AllowedPatterns.

lib/puppet/provider/base_dsc_lite/powershell.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ def exists?
7878
Puppet.debug "Dsc Resource returned: #{output}"
7979
data = JSON.parse(output)
8080
raise(data['errormessage']) unless data['errormessage'].empty?
81+
8182
exists = data['indesiredstate']
8283
Puppet.debug "Dsc Resource Exists?: #{exists}"
8384
Puppet.debug "dsc_ensure: #{resource[:dsc_ensure]}" if resource.parameters.key?(:dsc_ensure)

lib/puppet/type/dsc.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def change_to_s(currentvalue, newvalue)
7474
validate do |value|
7575
raise ArgumentError, "A non-empty #{name} must be specified." if value.nil? || value.empty?
7676
raise "#{name} should be a Hash or String" unless value.is_a?(Hash) || value.is_a?(String)
77+
7778
if value.is_a?(Hash)
7879
valid_keys = ['name', 'version']
7980
raise(_('Must specify name and version if using ModuleSpecification')) unless (value.keys & valid_keys) == value.keys

0 commit comments

Comments
 (0)