File tree Expand file tree Collapse file tree 7 files changed +25
-13
lines changed
lib/puppet/provider/package Expand file tree Collapse file tree 7 files changed +25
-13
lines changed Original file line number Diff line number Diff line change @@ -23,22 +23,9 @@ Layout:
23
23
Exclude :
24
24
- ' lib/puppet/defaults.rb'
25
25
26
- # The confine statements in package providers unexpectedly affect this cop.
27
- Layout/BeginEndAlignment :
28
- Enabled : true
29
- Exclude :
30
- - ' lib/puppet/provider/package/*.rb'
31
-
32
- Layout/ElseAlignment :
33
- Enabled : true
34
- Exclude :
35
- - ' lib/puppet/provider/package/*.rb'
36
-
37
26
# We don't mind when module and class keywords are aligned.
38
27
Layout/IndentationWidth :
39
28
AllowedPatterns : ['^\s*module']
40
- Exclude :
41
- - ' lib/puppet/provider/package/*.rb'
42
29
43
30
Layout/LineEndStringConcatenationIndentation :
44
31
Enabled : true
Original file line number Diff line number Diff line change @@ -78,13 +78,16 @@ def flush
78
78
# Debian boxes, and the only thing that differs is that it can
79
79
# install packages from remote sites.
80
80
81
+ # Double negation confuses Rubocop's Layout cops
82
+ # rubocop:disable Layout
81
83
def checkforcdrom
82
84
have_cdrom = begin
83
85
!!( File . read ( "/etc/apt/sources.list" ) =~ /^[^#]*cdrom:/ )
84
86
rescue
85
87
# This is basically pathological...
86
88
false
87
89
end
90
+ # rubocop:enable Layout
88
91
89
92
if have_cdrom and @resource [ :allowcdrom ] != :true
90
93
raise Puppet ::Error ,
Original file line number Diff line number Diff line change 12
12
commands :aptcache => "apt-cache"
13
13
commands :rpm => "rpm"
14
14
15
+ # Mixing confine statements, control expressions, and exception handling
16
+ # confuses Rubocop's Layout cops, so we disable them entirely.
17
+ # rubocop:disable Layout
15
18
if command ( 'rpm' )
16
19
confine :true => begin
17
20
rpm ( '-ql' , 'rpm' )
21
24
true
22
25
end
23
26
end
27
+ # rubocop:enable Layout
24
28
25
29
# Install a package using 'apt-get'. This function needs to support
26
30
# installing a specific version.
Original file line number Diff line number Diff line change 20
20
# never try to use RPM on a machine without it. We think this
21
21
# has probably become obsolete with the way `commands` work, so
22
22
# we should investigate removing it at some point.
23
+ #
24
+ # Mixing confine statements, control expressions, and exception handling
25
+ # confuses Rubocop's Layout cops, so we disable them entirely.
26
+ # rubocop:disable Layout
23
27
if command ( 'rpm' )
24
28
confine :true => begin
25
29
rpm ( '--version' )
29
33
true
30
34
end
31
35
end
36
+ # rubocop:enable Layout
32
37
33
38
defaultfor 'os.name' => :fedora
34
39
notdefaultfor 'os.name' => :fedora , 'os.release.major' => ( 19 ..21 ) . to_a
Original file line number Diff line number Diff line change 31
31
32
32
commands :rpm => "rpm"
33
33
34
+ # Mixing confine statements, control expressions, and exception handling
35
+ # confuses Rubocop's Layout cops, so we disable them entirely.
36
+ # rubocop:disable Layout
34
37
if command ( 'rpm' )
35
38
confine :true => begin
36
39
rpm ( '--version' )
40
43
true
41
44
end
42
45
end
46
+ # rubocop:enable Layout
43
47
44
48
def self . current_version
45
49
return @current_version unless @current_version . nil?
Original file line number Diff line number Diff line change 16
16
# never try to use RPM on a machine without it. We think this
17
17
# has probably become obsolete with the way `commands` work, so
18
18
# we should investigate removing it at some point.
19
+ #
20
+ # Mixing confine statements, control expressions, and exception handling
21
+ # confuses Rubocop's Layout cops, so we disable them entirely.
22
+ # rubocop:disable Layout
19
23
if command ( 'rpm' )
20
24
confine :true => begin
21
25
rpm ( '--version' )
25
29
true
26
30
end
27
31
end
32
+ # rubocop:enable Layout
28
33
29
34
defaultfor 'os.name' => "PhotonOS"
30
35
end
Original file line number Diff line number Diff line change 24
24
25
25
commands :cmd => "yum" , :rpm => "rpm"
26
26
27
+ # Mixing confine statements, control expressions, and exception handling
28
+ # confuses Rubocop's Layout cops, so we disable them entirely.
29
+ # rubocop:disable Layout
27
30
if command ( 'rpm' )
28
31
confine :true => begin
29
32
rpm ( '--version' )
33
36
true
34
37
end
35
38
end
39
+ # rubocop:enable Layout
36
40
37
41
defaultfor 'os.name' => :amazon
38
42
defaultfor 'os.family' => :redhat , 'os.release.major' => ( 4 ..7 ) . to_a
You can’t perform that action at this time.
0 commit comments