Skip to content

Commit ab6facd

Browse files
committed
Layout/EmptyLinesAroundAttributeAccessor
This commit enables the Rubocop Layout/EmptyLinesAroundAttributeAccessor cop and fixes all offenses.
1 parent 1902d9d commit ab6facd

34 files changed

+49
-6
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@ Layout/EmptyLineAfterGuardClause:
3030
Layout/EmptyLineAfterMagicComment:
3131
Enabled: false
3232

33-
# This cop supports safe auto-correction (--auto-correct).
34-
# Configuration parameters: AllowAliasSyntax, AllowedMethods.
35-
# AllowedMethods: alias_method, public, protected, private
36-
Layout/EmptyLinesAroundAttributeAccessor:
37-
Enabled: false
38-
3933
# This cop supports safe auto-correction (--auto-correct).
4034
Layout/EmptyLinesAroundBeginBody:
4135
Exclude:

lib/puppet/confine.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def self.test(name)
4242

4343
# Mark that this confine is used for testing binary existence.
4444
attr_accessor :for_binary
45+
4546
def for_binary?
4647
for_binary
4748
end

lib/puppet/confine_collection.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def confine(hash)
2626
end
2727

2828
attr_reader :label
29+
2930
def initialize(label)
3031
@label = label
3132
@confines = []

lib/puppet/error.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ module Puppet
33
# The base class for all Puppet errors. It can wrap another exception
44
class Error < RuntimeError
55
attr_accessor :original
6+
67
def initialize(message, original=nil)
78
super(message.scrub)
89
@original = original

lib/puppet/file_serving/base.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def initialize(path, links: nil, relative_path: nil, source: nil)
4444

4545
# Determine how we deal with links.
4646
attr_reader :links
47+
4748
def links=(value)
4849
value = value.to_sym
4950
value = :manage if value == :ignore
@@ -54,6 +55,7 @@ def links=(value)
5455

5556
# Set our base path.
5657
attr_reader :path
58+
5759
def path=(path)
5860
raise ArgumentError.new(_("Paths must be fully qualified")) unless Puppet::FileServing::Base.absolute?(path)
5961
@path = path
@@ -62,6 +64,7 @@ def path=(path)
6264
# Set a relative path; this is used for recursion, and sets
6365
# the file's path relative to the initial recursion point.
6466
attr_reader :relative_path
67+
6568
def relative_path=(path)
6669
raise ArgumentError.new(_("Relative paths must not be fully qualified")) if Puppet::FileServing::Base.absolute?(path)
6770
@relative_path = path

lib/puppet/file_serving/configuration.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def self.configuration
2222
private_class_method :new
2323

2424
attr_reader :mounts
25+
2526
#private :mounts
2627

2728
# Find the right mount. Does some shenanigans to support old-style module

lib/puppet/graph/rb_tree_map.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ def to_hash
198198

199199
class Node # :nodoc: all
200200
attr_accessor :color, :key, :value, :left, :right
201+
201202
def initialize(key, value)
202203
@key = key
203204
@value = value

lib/puppet/interface/action.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ def to_s() "#{@face}##{@name}" end
5757
# @return [Boolean]
5858
# @api private
5959
attr_accessor :default
60+
6061
def default?
6162
!!@default
6263
end
@@ -141,6 +142,7 @@ def __render_method_name_for(type)
141142
# @api private
142143
# @return [Symbol]
143144
attr_reader :render_as
145+
144146
def render_as=(value)
145147
@render_as = value.to_sym
146148
end
@@ -218,6 +220,7 @@ def deprecated?
218220
# The block that is executed when the action is invoked
219221
# @return [block]
220222
attr_reader :when_invoked
223+
221224
def when_invoked=(block)
222225

223226
internal_name = "#{@name} implementation, required on Ruby 1.8".to_sym

lib/puppet/interface/documentation.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ def copyright(owner = nil, years = nil)
267267
# @return [String] Comma-separated list of copyright owners
268268
# @api private
269269
attr_reader :copyright_owner
270+
270271
def copyright_owner=(value)
271272
case value
272273
when String then @copyright_owner = value
@@ -283,6 +284,7 @@ def copyright_owner=(value)
283284
# @return [String]
284285
# @api private
285286
attr_reader :copyright_years
287+
286288
def copyright_years=(value)
287289
years = munge_copyright_year value
288290
years = (years.is_a?(Array) ? years : [years])

lib/puppet/interface/option.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ def default
135135
end
136136

137137
attr_reader :parent, :name, :aliases, :optparse, :required
138+
138139
def required=(value)
139140
if has_default?
140141
raise ArgumentError, _("%{name} can't be optional and have a default value") % { name: self }
@@ -143,6 +144,7 @@ def required=(value)
143144
end
144145

145146
attr_reader :before_action
147+
146148
def before_action=(proc)
147149
unless proc.is_a? Proc
148150
#TRANSLATORS 'proc' is a Ruby block of code
@@ -154,6 +156,7 @@ def before_action=(proc)
154156
end
155157

156158
attr_reader :after_action
159+
157160
def after_action=(proc)
158161
unless proc.is_a? Proc
159162
#TRANSLATORS 'proc' is a Ruby block of code

0 commit comments

Comments
 (0)