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:
2323 Exclude :
2424 - ' lib/puppet/defaults.rb'
2525
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-
3726# We don't mind when module and class keywords are aligned.
3827Layout/IndentationWidth :
3928 AllowedPatterns : ['^\s*module']
40- Exclude :
41- - ' lib/puppet/provider/package/*.rb'
4229
4330Layout/LineEndStringConcatenationIndentation :
4431 Enabled : true
Original file line number Diff line number Diff line change @@ -78,13 +78,16 @@ def flush
7878 # Debian boxes, and the only thing that differs is that it can
7979 # install packages from remote sites.
8080
81+ # Double negation confuses Rubocop's Layout cops
82+ # rubocop:disable Layout
8183 def checkforcdrom
8284 have_cdrom = begin
8385 !!( File . read ( "/etc/apt/sources.list" ) =~ /^[^#]*cdrom:/ )
8486 rescue
8587 # This is basically pathological...
8688 false
8789 end
90+ # rubocop:enable Layout
8891
8992 if have_cdrom and @resource [ :allowcdrom ] != :true
9093 raise Puppet ::Error ,
Original file line number Diff line number Diff line change 1212 commands :aptcache => "apt-cache"
1313 commands :rpm => "rpm"
1414
15+ # Mixing confine statements, control expressions, and exception handling
16+ # confuses Rubocop's Layout cops, so we disable them entirely.
17+ # rubocop:disable Layout
1518 if command ( 'rpm' )
1619 confine :true => begin
1720 rpm ( '-ql' , 'rpm' )
2124 true
2225 end
2326 end
27+ # rubocop:enable Layout
2428
2529 # Install a package using 'apt-get'. This function needs to support
2630 # installing a specific version.
Original file line number Diff line number Diff line change 2020 # never try to use RPM on a machine without it. We think this
2121 # has probably become obsolete with the way `commands` work, so
2222 # 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
2327 if command ( 'rpm' )
2428 confine :true => begin
2529 rpm ( '--version' )
2933 true
3034 end
3135 end
36+ # rubocop:enable Layout
3237
3338 defaultfor 'os.name' => :fedora
3439 notdefaultfor 'os.name' => :fedora , 'os.release.major' => ( 19 ..21 ) . to_a
Original file line number Diff line number Diff line change 3131
3232 commands :rpm => "rpm"
3333
34+ # Mixing confine statements, control expressions, and exception handling
35+ # confuses Rubocop's Layout cops, so we disable them entirely.
36+ # rubocop:disable Layout
3437 if command ( 'rpm' )
3538 confine :true => begin
3639 rpm ( '--version' )
4043 true
4144 end
4245 end
46+ # rubocop:enable Layout
4347
4448 def self . current_version
4549 return @current_version unless @current_version . nil?
Original file line number Diff line number Diff line change 1616 # never try to use RPM on a machine without it. We think this
1717 # has probably become obsolete with the way `commands` work, so
1818 # 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
1923 if command ( 'rpm' )
2024 confine :true => begin
2125 rpm ( '--version' )
2529 true
2630 end
2731 end
32+ # rubocop:enable Layout
2833
2934 defaultfor 'os.name' => "PhotonOS"
3035end
Original file line number Diff line number Diff line change 2424
2525 commands :cmd => "yum" , :rpm => "rpm"
2626
27+ # Mixing confine statements, control expressions, and exception handling
28+ # confuses Rubocop's Layout cops, so we disable them entirely.
29+ # rubocop:disable Layout
2730 if command ( 'rpm' )
2831 confine :true => begin
2932 rpm ( '--version' )
3336 true
3437 end
3538 end
39+ # rubocop:enable Layout
3640
3741 defaultfor 'os.name' => :amazon
3842 defaultfor 'os.family' => :redhat , 'os.release.major' => ( 4 ..7 ) . to_a
You can’t perform that action at this time.
0 commit comments